diff options
-rw-r--r-- | lib.macros.lisp | 6 | ||||
-rw-r--r-- | packages.lisp | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/lib.macros.lisp b/lib.macros.lisp index 5489564..f02e7a2 100644 --- a/lib.macros.lisp +++ b/lib.macros.lisp @@ -77,3 +77,9 @@ arguments `LAMBDA-LIST' with body `BODY'." (declaim (ftype ,type ,name)) (defun ,name ,lambda-list ,@body))) + +(defmacro $ (&rest forms) + "Given a sequence of FORMS, return a unary function which applies each form +sequentially" + `(lambda (x) + (->> x ,@forms))) diff --git a/packages.lisp b/packages.lisp index aff5b68..d50945b 100644 --- a/packages.lisp +++ b/packages.lisp @@ -22,7 +22,8 @@ (:export :_ :--> :->> :while - :-> :fn)) + :-> :fn + :$)) (defpackage lib.functions (:use :cl :lib.macros) |