swap
tuple | vector →
swap(
first: integer,
second: integer
) → tuple | vector
Returns a tuple with two positions exchanged, defaulting to the first and last positions.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
first | integer | Yes | Specifies the first zero-based position. |
second | integer | Yes | Specifies the second zero-based position. |
Argument evaluation
first: Evaluated once in the enclosing context.second: Evaluated once in the enclosing context.
Examples
T("a", "b", "c", "d") | swap → T("d", "b", "c", "a")
Kind: Function
Scope: tuple
Aliases: swap