774 |
|
|
775 |
@deffn {Scheme Procedure} alist-delete key alist [=] |
@deffn {Scheme Procedure} alist-delete key alist [=] |
776 |
@deffnx {Scheme Procedure} alist-delete! key alist [=] |
@deffnx {Scheme Procedure} alist-delete! key alist [=] |
777 |
Return a list containing the pairs of @var{alist}, but without the |
Return a list containing the elements of @var{alist} but with those |
778 |
pairs whose @sc{cars} are equal to @var{key}. Equality is determined |
elements whose keys are equal to @var{key} deleted. The returned |
779 |
by @var{=}, which defaults to @code{equal?} if not given. |
elements will be in the same order as they were in @var{alist}. |
780 |
|
|
781 |
@code{alist-delete!} is allowed, but not required to modify the |
Equality is determined by the @var{=} predicate, or @code{equal?} if |
782 |
structure of the list @var{alist} in order to produce the result. |
not given. The order in which elements are tested is unspecified, but |
783 |
|
each equality call is made @code{(= key alistkey)}, ie. the given |
784 |
|
@var{key} parameter is first and the key from @var{alist} second. |
785 |
|
This means for instance all associations with a key greater than 5 can |
786 |
|
be removed with @code{(alist-delete 5 alist <)}. |
787 |
|
|
788 |
|
@code{alist-delete} does not modify @var{alist}, but the return might |
789 |
|
share a common tail with @var{alist}. @code{alist-delete!} may modify |
790 |
|
the list structure of @var{alist} to construct its return. |
791 |
@end deffn |
@end deffn |
792 |
|
|
793 |
|
|