| www.delorie.com/gnu/docs/emacs/cl_55.html | search |
![]() Buy the book! | |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
An association list is a list representing a mapping from one set of values to another; any list whose elements are cons cells is an association list.
car matches (in the sense of :test,
:test-not, and :key, or by comparison with eql)
a given item. It returns the matching element, if any,
otherwise nil. It ignores elements of a-list which
are not cons cells. (This corresponds to the behavior of
assq and assoc in Emacs Lisp; Common Lisp's
assoc ignores nils but considers any other non-cons
elements of a-list to be an error.)
cdr matches
item. If a-list represents a mapping, this applies
the inverse of the mapping to item.
The assoc-if, assoc-if-not, rassoc-if,
and rassoc-if-not functions are defined similarly.
Two simple functions for constructing association lists are:
(cons (cons key value) alist).
(nconc (mapcar* 'cons keys values)
alist).
| webmaster donations bookstore | delorie software privacy |
| Copyright © 2003 by The Free Software Foundation | Updated Jun 2003 |