Rework $ operator to take a capture variable
In case operators require use of a variable, we should let the caller provide the symbol so we don't fall into weird package issues.
This commit is contained in:
@@ -80,11 +80,11 @@ arguments `LAMBDA-LIST' with body `BODY'."
|
||||
(defun ,name ,lambda-list
|
||||
,@body)))
|
||||
|
||||
(defmacro $ (&rest forms)
|
||||
(defmacro $ (capture &rest forms)
|
||||
"Given a sequence of FORMS, return a unary function which applies each form
|
||||
sequentially"
|
||||
`(lambda (x)
|
||||
(->> x ,@forms)))
|
||||
`(lambda (,capture)
|
||||
(->> ,capture ,@forms)))
|
||||
|
||||
(defmacro alist-val (key alist)
|
||||
"Helper macro for getting the value of KEY in ALIST."
|
||||
|
||||
Reference in New Issue
Block a user