From b29855047be9a172d570db71600425b2b06a8a59 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Mon, 10 Feb 2025 07:14:05 +0000 Subject: Implement `$` operator, second class version of the applicative operator The `$` operator takes a sequence of FORMS and returns a unary function which applies the input through that sequence via the `->>` operator. For example, consider the predicate "not null". `null` is built into Common Lisp but "not null" requires writing a function (lambda (x) (not (null x))). Now, using this operator, you can write ($ not null) which returns the same lambda as above while being more concise. --- packages.lisp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'packages.lisp') 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) -- cgit v1.2.3-13-gbd6f