SequenceType

SequenceType[var]

represents a type parameterized by var that refers to a sequence of zero or more types.

Details

  • SequenceType does not evaluate on its own but can be used inside functions that accept types, including Typed, FunctionDeclaration, etc.
  • SequenceType is used to specify the type of functions that take a variable number of arguments.
  • A function definition that uses SequenceType is typically accompanied by one or more definitions that use a fixed number of arguments.

Examples

Basic Examples  (1)

Represent the type of a function that accepts a "MachineInteger" type and a sequence of types; it returns a "MachineInteger":

Represent a declaration of a function with this type:

This function declaration takes a single "MachineInteger":

Compile a program that calls the declarations with three arguments:

Compile another program that calls the declarations but with a different number of arguments:

Wolfram Research (2023), SequenceType, Wolfram Language function, https://reference.wolfram.com/language/ref/SequenceType.html.

Text

Wolfram Research (2023), SequenceType, Wolfram Language function, https://reference.wolfram.com/language/ref/SequenceType.html.

CMS

Wolfram Language. 2023. "SequenceType." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SequenceType.html.

APA

Wolfram Language. (2023). SequenceType. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SequenceType.html

BibTeX

@misc{reference.wolfram_2024_sequencetype, author="Wolfram Research", title="{SequenceType}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/SequenceType.html}", note=[Accessed: 27-April-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_sequencetype, organization={Wolfram Research}, title={SequenceType}, year={2023}, url={https://reference.wolfram.com/language/ref/SequenceType.html}, note=[Accessed: 27-April-2024 ]}