mirror of
https://github.com/fiddlerwoaroof/data-lens.git
synced 2025-11-08 10:16:32 +00:00
chore: more tests, fixes
- add DELAY - fix definition of OF-MAX-LENGTH - add ignorable declaration to CONJ and DISJ - lots of new tests
This commit is contained in:
10
lens.lisp
10
lens.lisp
@ -102,7 +102,7 @@
|
||||
|
||||
(defun-ct of-max-length (len)
|
||||
(lambda (it)
|
||||
(>= (length it)
|
||||
(<= (length it)
|
||||
len)))
|
||||
|
||||
(defun-ct applicable-when (fun test)
|
||||
@ -114,6 +114,7 @@
|
||||
(defmacro conj (&rest fns)
|
||||
(let ((dat (gensym "dat")))
|
||||
`(lambda (,dat)
|
||||
(declare (ignorable ,dat))
|
||||
(and ,@(mapcar (lambda (fn)
|
||||
`(funcall ,fn ,dat))
|
||||
fns)))))
|
||||
@ -226,6 +227,13 @@
|
||||
(apply f args))
|
||||
r)))))
|
||||
|
||||
(defun delay ()
|
||||
"Return a function that always returns the last thing it was called with"
|
||||
(let ((result nil))
|
||||
(lambda (v)
|
||||
(prog1 result
|
||||
(setf result v)))))
|
||||
|
||||
(defun =>> (fun1 fun2)
|
||||
(lambda (i)
|
||||
(prog1 (funcall fun1 i)
|
||||
|
||||
Reference in New Issue
Block a user