mirror of
https://github.com/fiddlerwoaroof/data-lens.git
synced 2025-11-08 10:16:32 +00:00
feat: add compiler macro for functionalize
This commit is contained in:
10
lens.lisp
10
lens.lisp
@ -24,6 +24,16 @@
|
|||||||
(:method ((it function))
|
(:method ((it function))
|
||||||
it))
|
it))
|
||||||
|
|
||||||
|
(define-compiler-macro functionalize (&whole whole it)
|
||||||
|
(typecase it
|
||||||
|
(cons (destructuring-bind (h . tail) it
|
||||||
|
(declare (ignore tail))
|
||||||
|
(case h
|
||||||
|
(quote it)
|
||||||
|
(function it)
|
||||||
|
(t whole))))
|
||||||
|
(t whole)))
|
||||||
|
|
||||||
;;; TODO: consider making this wrap defalias?
|
;;; TODO: consider making this wrap defalias?
|
||||||
(defmacro shortcut (name function &body bound-args)
|
(defmacro shortcut (name function &body bound-args)
|
||||||
`(eval-when (:load-toplevel :compile-toplevel :execute)
|
`(eval-when (:load-toplevel :compile-toplevel :execute)
|
||||||
|
|||||||
Reference in New Issue
Block a user