mirror of
https://github.com/fiddlerwoaroof/data-lens.git
synced 2025-11-08 18:26:32 +00:00
More tweaks to example
This commit is contained in:
@ -4,7 +4,9 @@ This library provides a language for expressing data manipulations as
|
||||
the composition of more primitive operations.
|
||||
|
||||
#+BEGIN_SRC lisp
|
||||
DATA-LENS> (funcall (on (compress-runs :collector 'combine-matching-lists)
|
||||
DATA-LENS> (funcall (on (alexandria:compose
|
||||
(over (transform-tail (over (slice 1))))
|
||||
(compress-runs :collector 'combine-matching-lists))
|
||||
(alexandria:compose
|
||||
(over (data-lens:juxt
|
||||
(data-lens:element 0)
|
||||
|
||||
@ -102,6 +102,15 @@
|
||||
(lambda (seq)
|
||||
(map 'list selector seq)))
|
||||
|
||||
(defun slice (start &optional end)
|
||||
(lambda (it)
|
||||
(subseq it start end)))
|
||||
|
||||
(defun-ct transform-tail (fun)
|
||||
(lambda (it)
|
||||
(list* (car it)
|
||||
(funcall fun (cdr it)))))
|
||||
|
||||
(defun-ct key-transform (fun key-get key-set)
|
||||
(lambda (it)
|
||||
(let ((key-val (funcall key-get it)))
|
||||
|
||||
Reference in New Issue
Block a user