reverse!

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 source-sequence may be modified by this operation.  The result-sequence may or may not be freshly allocated.  The source-sequence and the result-sequence may or may not be ==.  Programs should never rely on this operation performing a side-effect on an existing sequence, but should instead use the value returned by the function.

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*
⇒ {undefined}

Exported from

Modifiers

open

Arguments

source-sequenceAn instance of <sequence>.

Values

result-sequenceAn instance of <sequence>.
Summary
Returns a sequence containing the same elements as a source sequence, but in reverse order.
The result of reverse! on a <range> is == to the range argument.

Functions

reverse

The result of reverse! on a <range> is == to the range argument.  An unbounded range cannot be reversed.

Returns a sequence containing the same elements as a source sequence, but in reverse order.
The class of arithmetic sequences.
The common-dylan module.
Whenever possible, we have tried to keep the Dylan module pristine and unextended, preferring to add our extensions to separate modules or libraries.
The class of collections whose keys are consecutive integers starting from zero.