Adds an element to a sequence, possibly modifying the 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 and result-sequence may or may not be ==.
source-sequence may be modified by this operation.
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* = list (3, 4, 5)
add! (*numbers*, 1)
⇒ #(1, 3, 4, 5)
*numbers*
⇒ {undefined}
open
| source-sequence | An instance of type-union(<set>, <sequence>). |
| new-element | An instance of <object>. |
| result-sequence | An instance of type-union(<set>, <sequence>). |