Adds a new element to a sequence.
Adds new-element to source-sequence if it is not already an element of source-sequence, as determined by the test function. If new-element is already a member of source-sequence, then source-sequence is returned unmodified.
If an element is added, add-new operates just as add would.
The test function may be non-commutative: it is always called with an element from source-sequence as its first argument and new-element as its second argument.
add-new (#(3, 4, 5), 1)
⇒ #(1, 3, 4, 5)
add-new (#(3, 4, 5), 4)
⇒ #(3, 4, 5)
open
| source-sequence | An instance of <sequence>. |
| new-element | An instance of <object>. |
| test: | An instance of <function>. The default is ==. |
| result-sequence | An instance of <sequence>. |