Next: SRFI-1 Set Operations, Previous: SRFI-1 Deleting, Up: SRFI-1
Association lists are described in detail in section Association Lists. The present section only documents the additional procedures for dealing with association lists defined by SRFI-1.
Return the pair from alist which matches key. Equality is determined by =, which defaults to
equal?
if not given. alist must be an association lists—a list of pairs.This function extends the core
assoc
by accepting an equality predicate. (see Association Lists)
Cons a new association key and datum onto alist and return the result. This is equivalent to
(cons (cons key datum) alist)
acons
(see Adding or Setting Alist Entries) in the Guile core does the same thing.
Return a newly allocated copy of alist, that means that the spine of the list as well as the pairs are copied.
Return a list containing the elements of alist but with those elements whose keys are equal to key deleted. The returned elements will be in the same order as they were in alist.
Equality is determined by the = predicate, or
equal?
if not given. The order in which elements are tested is unspecified, but each equality call is made(= key alistkey)
, ie. the given key parameter is first and the key from alist second. This means for instance all associations with a key greater than 5 can be removed with(alist-delete 5 alist <)
.
alist-delete
does not modify alist, but the return might share a common tail with alist.alist-delete!
may modify the list structure of alist to construct its return.