mirror of
https://github.com/fiddlerwoaroof/data-lens.git
synced 2025-11-08 10:16:32 +00:00
feat: actually add CONJ and DISJ
This commit is contained in:
15
lens.lisp
15
lens.lisp
@ -111,6 +111,21 @@
|
||||
(funcall fun it)
|
||||
it)))
|
||||
|
||||
(defmacro conj (&rest fns)
|
||||
(let ((dat (gensym "dat")))
|
||||
`(lambda (,dat)
|
||||
(and ,@(mapcar (lambda (fn)
|
||||
`(funcall ,fn ,dat))
|
||||
fns)))))
|
||||
|
||||
(defmacro disj (&rest fns)
|
||||
(let ((dat (gensym "dat")))
|
||||
`(lambda (,dat)
|
||||
(or ,@(mapcar (lambda (fn)
|
||||
`(funcall ,fn ,dat))
|
||||
fns)))))
|
||||
|
||||
|
||||
(defun-ct sorted (comparator &rest r &key key)
|
||||
(declare (ignore key))
|
||||
(lambda (it)
|
||||
|
||||
Reference in New Issue
Block a user