Returns a sequence containing the same elements as a source sequence, but in reverse order. The result-sequence is generally of the same class as the source-sequence.
The result-sequence may or may not be freshly allocated. The source-sequence is not modified by this operation.
The consequences are undefined if the source-sequence is unbounded (circular or infinite).
define variable *x* = list("bim", "bam", "boom")
*x*
⇒ #("bim", "bam", "boom")
reverse(*x*)
⇒ #("boom", "bam", "bim")
*x*
⇒ #("bim", "bam", "boom")open
| source-sequence | An instance of <sequence>. |
| result-sequence | An instance of <sequence>. |
Reversing a <range> produces another range. An unbounded range cannot be reversed.