Adds an element to a sequence.
Returns a sequence that contains new-element and all the elements of source-sequence. The result-sequence may or may not be freshly allocated. It may share structure with a preexisting sequence.
source-sequence is not modified by this operation.
The result-sequence’s size is one greater than the size of source-sequence. The generic function add doesn’t specify where the new element will be added, although individual methods may do so.
define variable *numbers* = #(3, 4, 5)
add (*numbers*, 1)
⇒ #(1, 3, 4, 5)
*numbers*
⇒ #(3, 4, 5)
open
| source-sequence | An instance of <sequence>. |
| new-element | An instance of <object>. |
| result-sequence | An instance of <sequence>. |