mirror of
https://github.com/fiddlerwoaroof/data-lens.git
synced 2025-11-08 18:26:32 +00:00
feat(utils): use FUNCTIONALIZE in data-lens. Slightly incompatible
This commit is contained in:
14
lens.lisp
14
lens.lisp
@ -248,8 +248,9 @@
|
||||
:initial-value ()))))
|
||||
|
||||
(defun-ct over (fun &key (result-type 'list))
|
||||
(let ((fun (functionalize fun)))
|
||||
(lambda (seq)
|
||||
(map result-type fun seq)))
|
||||
(map result-type fun seq))))
|
||||
|
||||
(defun-ct denest (&key (result-type 'list))
|
||||
(lambda (seq)
|
||||
@ -257,13 +258,16 @@
|
||||
seq)))
|
||||
|
||||
(defmacro applying (fun &rest args)
|
||||
(alexandria:with-gensyms (seq)
|
||||
`(lambda (,seq)
|
||||
(apply ,fun ,@args ,seq))))
|
||||
(alexandria:with-gensyms (seq fsym)
|
||||
`(let ((,fsym (functionalize ,fun)))
|
||||
(lambda (,seq)
|
||||
(apply ,fsym ,@args ,seq)))))
|
||||
|
||||
(defun-ct on (fun key)
|
||||
(let ((fun (functionalize fun))
|
||||
(key (functionalize key)))
|
||||
(lambda (it)
|
||||
(funcall fun (funcall key it))))
|
||||
(funcall fun (funcall key it)))))
|
||||
|
||||
(defun filler (length1 length2 fill-value)
|
||||
(if (< length1 length2)
|
||||
|
||||
Reference in New Issue
Block a user