[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
6.7.12 Association Lists
An association list is a conventional data structure that is often used
to implement simple key-value databases. It consists of a list of
entries in which each entry is a pair. The key of each entry is
the car
of the pair and the value of each entry is the
cdr
.
ASSOCIATION LIST ::= '( (KEY1 . VALUE1) (KEY2 . VALUE2) (KEY3 . VALUE3) … )
Association lists are also known, for short, as alists.
The structure of an association list is just one example of the infinite
number of possible structures that can be built using pairs and lists.
As such, the keys and values in an association list can be manipulated
using the general list structure procedures cons
, car
,
cdr
, set-car!
, set-cdr!
and so on. However,
because association lists are so useful, Guile also provides specific
procedures for manipulating them.
6.7.12.1 Alist Key Equality | ||
6.7.12.2 Adding or Setting Alist Entries | ||
6.7.12.3 Retrieving Alist Entries | ||
6.7.12.4 Removing Alist Entries | ||
6.7.12.5 Sloppy Alist Functions | ||
6.7.12.6 Alist Example |
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on April 20, 2013 using texi2html 5.0.