Removes an element from a sequence.
Returns a sequence consisting of the elements of source-sequence not equal to value. The result-sequence may or may not be freshly allocated. However, the source-sequence is never modified by remove.
test is a function that determines whether an element is equal to value. The test function may be non-commutative: it is always called with an element from source-sequence as its first argument and value as its second argument.
If count is #f, then all copies of value are removed. Otherwise, no more than count copies of value are removed (so additional elements equal to value might remain in result-sequence).
define variable *old-list* = list(1, 2, 3)
define variable *new-list* = remove(*old-list*, 1)
*new-list*
⇒ #(2, 3)
*new-list* == tail(*old-list*)
⇒ {undefined}
open
| source-sequence | An instance of <sequence>. |
| value | An instance of <object>. |
| test: | An instance of <function>. The default is ==. |
| count: | An instance of <integer> or #f. The default is #f. |
| result-sequence | An instance of <sequence>. |