Association-list bootstrap: get/has?/del/put/keys and let-opts.
The bootstrap layer the object system runs on, plus the let-opts form.
The full association API is the Assoc class: (Assoc merge a b), (Assoc map f al), …
%assoc-getLook up a key in an alist, returning its value or nil.
Bootstrap layer: the object system dispatches through this. Class API: (Assoc get …).
Parameters:
SYMBOL — Key to look upLIST — Association listReturns: ANY — Value associated with key, or nil if not found
%assoc-has?Test whether a key exists in an alist.
Bootstrap layer: the object system dispatches through this. Class API: (Assoc has? …).
Parameters:
SYMBOL — Key to checkLIST — Association listReturns: BOOL — True if key is present
%assqLook up a key in an alist, returning the entry pair or nil.
Entry-returning eq? lookup. Class API: (Assoc entry …).
Parameters:
SYMBOL — Key to look up (eq? comparison)LIST — Association listReturns: ANY — The (key . value) entry pair, or nil if not found
%assoc-strLook up a string key in an alist, returning the entry pair or nil.
The str=? side of the key-equality split: tables keyed by converted (cross-base) names use this.
Parameters:
STR — String key (str=? comparison)LIST — Alist with string keysReturns: ANY — The (key . value) entry pair, or nil if not found
%assoc-delRemove all entries for a key from an alist.
Bootstrap layer. Class API: (Assoc del …).
Parameters:
SYMBOL — Key to removeLIST — Association listReturns: LIST — Alist without the given key
%assoc-putSet a key-value pair, replacing any existing entry for that key.
Bootstrap layer: the object system dispatches through this. Class API: (Assoc put …).
Parameters:
SYMBOL — Key to setANY — Value to associateLIST — Association listReturns: LIST — Alist with the key set to val
%assoc-keysReturn all keys from an alist.
Bootstrap layer: the object system’s introspection uses this. Class API: (Assoc keys …).
Parameters:
LIST — Association listReturns: LIST — List of keys
let-optsBind locals from an option store (alist or plist) with lazy per-binding defaults.
Each binding is name (name default) (name key default). Defaults are
lazy (run only when the option is absent) and may reference earlier bindings.
The source evaluates to an alist ((k . v) …) or a flat plist (k v …).
Examples:
(let-opts '(a 1) ((a 0) (b 0)) (+ a b)) => 1See also: %assoc-get