Node:SRFI-1 Association Lists, Next:, Previous:SRFI-1 Deleting, Up:SRFI-1



39.3.9 Association Lists

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.

assoc key alist [=] Scheme Procedure
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.

alist-cons key datum alist Scheme Procedure
Equivalent to
(cons (cons key datum) alist)

This procedure is used to coons a new pair onto an existing association list.

alist-copy alist Scheme Procedure
Return a newly allocated copy of alist, that means that the spine of the list as well as the pairs are copied.

alist-delete key alist [=] Scheme Procedure
alist-delete! key alist [=] Scheme Procedure
Return a list containing the pairs of alist, but without the pairs whose CARS are equal to key. Equality is determined by =, which defaults to equal? if not given.

alist-delete! is allowed, but not required to modify the structure of the list alist in order to produce the result.