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.
|
the composition of more primitive operations.
|
||||||
|
|
||||||
#+BEGIN_SRC lisp
|
#+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
|
(alexandria:compose
|
||||||
(over (data-lens:juxt
|
(over (data-lens:juxt
|
||||||
(data-lens:element 0)
|
(data-lens:element 0)
|
||||||
|
|||||||
@ -102,6 +102,15 @@
|
|||||||
(lambda (seq)
|
(lambda (seq)
|
||||||
(map 'list selector 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)
|
(defun-ct key-transform (fun key-get key-set)
|
||||||
(lambda (it)
|
(lambda (it)
|
||||||
(let ((key-val (funcall key-get it)))
|
(let ((key-val (funcall key-get it)))
|
||||||
|
|||||||
Reference in New Issue
Block a user