84 lines
10 KiB
Plaintext
84 lines
10 KiB
Plaintext
Medley MULTI-ALIST
|
||
2
|
||
|
||
4
|
||
|
||
1
|
||
|
||
MULTI-ALIST
|
||
1
|
||
|
||
4
|
||
|
||
By Ron Kaplan
|
||
This document was last edited in January 2025.
|
||
|
||
MULTI-ALIST provides a collection of macros that make it easy to store and retrieve items in a hierarchical, multi-level association list indexed by an arbitrary number of keys. The macro PUTMULTI adds a new value to a list of indexed items and GETMULTI returns the items at that index.
|
||
(PUTMULTI PLACE KEY1...KEYn VAL) [Macro]
|
||
PLACE is a commonLIsp place, a form that can be passed as the first argument of CL:SETF. KEY1 through KEYn are the indexing keys and VAL is a new value to be pushed at the bottom of the multi-alist. The value of PUTMULTI is VAL. For example, if the variable WINES is initialized to NIL and the following expressions are evaluated
|
||
(PUTMULTI WINES 'RED 'DRY 'FRENCH 'CABERNET)ÿÿ |