Most of the following functions perform simple operations on a single sequence; make-sequence constructs a new sequence.
This returns the element of sequence specified by index, which must be a non-negative integer less than the length of the sequence as returned by length. The first element of a sequence has index 0.
(Note that elt observes the fill pointer in those vectors that have fill pointers. The array-specific function aref may be used to access vector elements that are beyond the vector’s fill pointer.)
setf may be used with elt to destructively replace a sequence element with a new value.
This returns the subsequence of sequence specified by start and end. subseq always allocates a new sequence for a result; it never shares storage with an old sequence. The result subsequence is always of the same type as the argument sequence.
setf may be used with subseq to destructively replace a subsequence with a sequence of new values; see also replace.
A copy is made of the argument sequence; the result is equalp to the argument but not eq to it.
but the name copy-seq is more perspicuous when applicable.
The number of elements in sequence is returned as a non-negative integer. If the sequence is a vector with a fill pointer, the “active length” as specified by the fill pointer is returned (see section 17.5).
The result is a new sequence of the same kind as sequence, containing the same elements but in reverse order. The argument is not modified.
The result is a sequence containing the same elements as sequence but in reverse order. The argument may be destroyed and re-used to produce the result. The result may or may not be eq to the argument, so it is usually wise to say something like (setq x (nreverse x)), because simply (nreverse x) is not guaranteed to leave a reversed value in x.
This returns a sequence of type type and of length size, each of whose elements has been initialized to the :initial-element argument. If specified, the :initial-element argument must be an object that can be an element of a sequence of type type. For example:
If an :initial-element argument is not specified, then the sequence will be initialized in an implementation-dependent way.
X3J13 voted in January 1989 to clarify that the type argument must be a type specifier, and the size argument must be a non-negative integer less than the value of array-dimension-limit.
X3J13 voted in June 1989 to specify that make-sequence should signal an error if the sequence type specifies the number of elements and the size argument is different.
X3J13 voted in March 1989 to specify that if type is string, the result is the same as if make-string had been called with the same size and :initial-element arguments.