1.4.9 Association Lists
An association list is a list of cons-pairs, representing a table in which the car of each pair maps to its cdr.
Examples: | ||||
|
Reports whether x is a proper association list.
Lookup function for association lists, using eql as test. Returns the first pair in alist whose key matches x. Otherwise returns nil.
Examples: | ||||
|
Examples: | ||||
|
(assoc-equal x alist) → t x : t alist : (alistp alist)
Examples: | ||||
|
(assoc-keyword key l) → t key : t l : (keyword-value-listp l)
Lookup function for a keyword-value-listp
Example: | ||
|
(assoc-string-equal str alist) → t str : (and (stringp str) (standard-char-listp (coerce str 'list))) alist : (standard-string-alistp alist)
Lookup function for association lists that have strings for keys
Examples: | ||||
|
(eqlable-alistp x) → t x : t
Recognizer for association lists of eqlablep items
Examples: | ||||||
|
(put-assoc-eq name val alist) → t name : t val : t alist : (if (symbolp name) (alistp alist) (symbol-alistp alist))
Modify an association list by associating a value with a key. Use this function for association lists whose keys are symbols.
Examples: | ||||
|
(put-assoc-eql name val alist) → t name : t val : t alist : (if (eqlable name) (alistp alist) (eqlable-alistp alist))
Modify an association list by associating a value with a key. Use this function for association lists whose keys are numbers, symbols, or characters.
Examples: | ||||||
|
(put-assoc-equal name val alist) → t name : t val : t alist : (alistp alist)
Modify an association list by associating a value with a key.
Examples: | ||||
|
Lookup function for association lists, using eql as test. Returns the first pair in alist whose value matches x. Otherwise returns nil. This function is similar to assoc, but whereas assoc checks for a pair whose car matches x, rassoc checks for a pair whose cdr matches.
Examples: | ||||
|
Examples: | ||||
|
(rassoc-equal x lst) → t x : t lst : (alistp lst)
Examples: | ||||
|
(standard-string-alistp x) → t x : t
Reports whether x is an association list of stringp elements, in which each string contains only standard-char-p characters.
Example: | ||
|
(strip-cars x) → t x : (alistp x)
Returns a list containing the cars of all the pairs in the given association list.
Example: | ||
|
(strip-cdrs x) → t x : (alistp x)
Returns a list containing the cdrs of all the pairs in the given association list.
Example: | ||
|
(sublis alst tree) → t alst : (eqlable-alistp alst) tree : t
Replaces every leaf of tree with the result of looking that leaf up in the given alist.
(symbol-alistp x) → t x : t
Reports whether x is an association list of symbolp elements.
Examples: | ||||
|
(pairlis$ x y) → t x : (true-listp x) y : (true-listp y)
Zipper together two lists