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:
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