aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2025-02-11 00:28:48 +0000
committerAryadev Chavali <aryadev@aryadevchavali.com>2025-02-11 00:40:19 +0000
commitae5cc7141d7a21e7d6ccb28e2df7b56c3ff1c0d0 (patch)
treeb14ac0e8664270a5ef9fae7a2c36aa2747b1d202
parentde653b67fb6ca567346516ae9880766cb421d135 (diff)
downloadcantedraw-ae5cc7141d7a21e7d6ccb28e2df7b56c3ff1c0d0.tar.gz
cantedraw-ae5cc7141d7a21e7d6ccb28e2df7b56c3ff1c0d0.tar.bz2
cantedraw-ae5cc7141d7a21e7d6ccb28e2df7b56c3ff1c0d0.zip
Rework rev-map to use ->> and to make LIST `cdrs` rather than CONS
-rw-r--r--lib.functions.lisp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib.functions.lisp b/lib.functions.lisp
index e3b3180..2e37f79 100644
--- a/lib.functions.lisp
+++ b/lib.functions.lisp
@@ -48,8 +48,9 @@ where key x in A has associations {y in LST : INDICATOR(y) = x}."
:for element :in lst
:for key = (funcall indicator element)
:if (assoc key assoc-list :test key-eq)
- :do (setf (alist-val key assoc-list)
- (cons element (alist-val key assoc-list)))
+ :do (->> (alist-val key assoc-list)
+ (cons element)
+ (setf (alist-val key assoc-list)))
:else
- :do (setq assoc-list (acons key element assoc-list))
+ :do (setq assoc-list (cons (list key element) assoc-list))
:finally (return assoc-list)))