| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
6.7.12.3 Retrieving Alist Entries
assq, assv and assoc find the entry in an alist
for a given key, and return the (key . value) pair.
assq-ref, assv-ref and assoc-ref do a similar
lookup, but return just the value.
- Scheme Procedure: assq key alist
- Scheme Procedure: assv key alist
- Scheme Procedure: assoc key alist
- C Function: scm_assq (key, alist)
- C Function: scm_assv (key, alist)
- C Function: scm_assoc (key, alist)
Return the first entry in alist with the given key. The return is the pair
(KEY . VALUE)from alist. If there’s no matching entry the return is#f.assqcompares keys witheq?,assvuseseqv?andassocusesequal?. See also SRFI-1 which has an extendedassoc(Association Lists).
- Scheme Procedure: assq-ref alist key
- Scheme Procedure: assv-ref alist key
- Scheme Procedure: assoc-ref alist key
- C Function: scm_assq_ref (alist, key)
- C Function: scm_assv_ref (alist, key)
- C Function: scm_assoc_ref (alist, key)
Return the value from the first entry in alist with the given key, or
#fif there’s no such entry.assq-refcompares keys witheq?,assv-refuseseqv?andassoc-refusesequal?.Notice these functions have the key argument last, like other
-reffunctions, but this is opposite to whatassqetc above use.When the return is
#fit can be either key not found, or an entry which happens to have value#fin thecdr. Useassqetc above if you need to differentiate these cases.
| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on April 20, 2013 using texi2html 5.0.
