Next: List Searching, Previous: Append/Reverse, Up: Lists
The following procedures modify an existing list, either by changing elements of the list, or by changing the list structure itself.
Set the kth element of lst to val.
Set the kth cdr of lst to val.
Return a newly-created copy of lst with elements
eq?to item removed.
Return a newly-created copy of lst with elements
eqv?to item removed.
Return a list containing all elements from lst, but without the elements equal to x. Equality is determined by the equality predicate =, which defaults to
equal?if not given.
delete!is allowed, but not required to modify the structure of the argument list in order to produce the result.
These procedures are destructive versions of
delq,delvanddelete: they modify the pointers in the existing lst rather than creating a new list.Caveat evaluator: Like other destructive list functions, these functions cannot modify the binding of lst, and so cannot be used to delete the first element of lst destructively.
Like
delq!, but only deletes the first occurrence of item from lst.