diff options
author | Nic Ferier <nic@ferrier.me.uk> | 2013-06-12 11:19:20 +0100 |
---|---|---|
committer | Nic Ferier <nic@ferrier.me.uk> | 2013-06-12 11:19:20 +0100 |
commit | f77f75b774297b89dd70f58f6d3765615e1b2d1d (patch) | |
tree | ad98fdc7965056c2b4f7ce433fa1d17fabd1c174 | |
parent | b227839532b7858ad5b70733dcfadf0653ce2e7f (diff) |
add a bunch of accessor functions to replace use of aget
-rw-r--r-- | kv.el | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -63,6 +63,26 @@ key." hash) store))) +(defun kva (key alist) + "Retrieve the value assigned to KEY in ALIST. + +This uses `assoc' as the lookup mechanism." + (cdr (assoc key alist))) + +(defun kvaq (key alist) + "Retrieve the value assigned to KEY in ALIST. + +This uses `assq' as the lookup mechanism." + (cdr (assq key alist))) + +(defun kvaqc (key alist) + "Retrieve the value assigned to KEY in ALIST. + +This uses first the `assq' and then `assoc' as the lookup +mechanism." + (cdr (or (assq key alist) + (assoc key alist)))) + (defun kvassoc= (key value alist) "Is the value assocd to KEY in ALIST equal to VALUE? |