www.delorie.com/gnu/docs/guile/guile_450.html   search  
 
Buy GNU books!


Guile Reference Manual

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

39.3.9 Association Lists

Association lists are described in detail in section 22.7.2 Association Lists. The present section only documents the additional procedures for dealing with association lists defined by SRFI-1.

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

Scheme Procedure: alist-cons key datum alist
Equivalent to

 
(cons (cons key datum) alist)

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

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

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


  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003