git.fiddlerwoaroof.com
Browse code

feat: add calling

Edward Langley authored on 26/03/2023 18:06:18
Showing 2 changed files
... ...
@@ -291,6 +291,11 @@
291 291
     (apply #'concatenate result-type
292 292
            seq)))
293 293
 
294
+(defmacro calling (fun &rest args)
295
+  (alexandria:with-gensyms (first-arg)
296
+    `(lambda (,first-arg)
297
+       (funcall (functionalize ,fun) ,first-arg ,@args))))
298
+
294 299
 (defmacro applying (fun &rest args)
295 300
   (alexandria:with-gensyms (seq fsym)
296 301
     `(let ((,fsym (functionalize ,fun)))
... ...
@@ -16,11 +16,11 @@
16 16
            #:defun-ct #:key #:extract-key #:element #:let-fn #:juxt
17 17
            #:transform-tail #:slice #:compress-runs
18 18
            #:combine-matching-lists #:sorted #:applicable-when
19
-           #:of-length #:of-min-length #:of-max-length
20
-           #:transform-head #:maximizing #:zipping #:applying
21
-           #:splice-elt #:transform-elt #:denest #:op #:defalias #:<>
22
-           #:<>1 #:== #:• #:suffixp #:functionalize #:inc #:group-by
23
-           #:keys #:conj #:disj #:delay))
19
+           #:of-length #:of-min-length #:of-max-length #:transform-head
20
+           #:maximizing #:zipping #:applying #:splice-elt
21
+           #:transform-elt #:denest #:op #:defalias #:<> #:<>1 #:== #:•
22
+           #:∘ #:suffixp #:functionalize #:inc #:group-by #:keys
23
+           #:conj #:disj #:delay #:calling))
24 24
 
25 25
 (defpackage :data-lens.transducers.internals
26 26
   (:use :cl)