aboutsummaryrefslogtreecommitdiff
path: root/lib.macros.lisp
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2025-02-10 18:10:06 +0000
committerAryadev Chavali <aryadev@aryadevchavali.com>2025-02-11 00:40:19 +0000
commit3e6da6b0f4abb6aa1f1274e183d039eeecebec86 (patch)
treed243fb012496c81cb618210b756306e7a69449b5 /lib.macros.lisp
parent5c6d444c2e73d6154a16ae9380662c2c75c6eafd (diff)
downloadcantedraw-3e6da6b0f4abb6aa1f1274e183d039eeecebec86.tar.gz
cantedraw-3e6da6b0f4abb6aa1f1274e183d039eeecebec86.tar.bz2
cantedraw-3e6da6b0f4abb6aa1f1274e183d039eeecebec86.zip
Macro (alist-val) to access the actual value of a key in an alist
Diffstat (limited to 'lib.macros.lisp')
-rw-r--r--lib.macros.lisp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib.macros.lisp b/lib.macros.lisp
index f02e7a2..a866193 100644
--- a/lib.macros.lisp
+++ b/lib.macros.lisp
@@ -83,3 +83,7 @@ arguments `LAMBDA-LIST' with body `BODY'."
sequentially"
`(lambda (x)
(->> x ,@forms)))
+
+(defmacro alist-val (key alist)
+ "Helper macro for getting the value of KEY in ALIST."
+ `(cdr (assoc ,key ,alist)))