aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2025-02-14 17:42:11 +0000
committerAryadev Chavali <aryadev@aryadevchavali.com>2025-02-14 17:42:11 +0000
commit955e921f8056b4cc858ea9798a14b91486cf9036 (patch)
tree9389a4e4c7741493e7ea3d6379fa5407a6c60574
parent2c8b5e711035f340e94fd3bd2bd8a7d8b51cbae7 (diff)
downloadcantedraw-955e921f8056b4cc858ea9798a14b91486cf9036.tar.gz
cantedraw-955e921f8056b4cc858ea9798a14b91486cf9036.tar.bz2
cantedraw-955e921f8056b4cc858ea9798a14b91486cf9036.zip
Leave `FORMS` as is in `$` operator.
`$` takes a list of forms and makes a unary function which applies them via `->>`. Previous definition reversed the forms supplied s.t. `$` was closer to the applicative operator in Haskell i.e. the function (<$> f g) is f(g(x)). But this version fits closer with the lower operator (->>) being used AND allows easier lifting from `->>` (which produces a value) to `$` (which produces a function).
-rw-r--r--lib.macros.lisp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib.macros.lisp b/lib.macros.lisp
index 70f5917..d182ce0 100644
--- a/lib.macros.lisp
+++ b/lib.macros.lisp
@@ -84,7 +84,7 @@ arguments `LAMBDA-LIST' with body `BODY'."
"Given a sequence of FORMS, return a unary function which applies each form
sequentially"
`(lambda (x)
- (->> x ,@(reverse forms))))
+ (->> x ,@forms)))
(defmacro alist-val (key alist)
"Helper macro for getting the value of KEY in ALIST."