|
|
|
|
@ -235,6 +235,38 @@ See also: `-reduce-r-from', `-reduce'" |
|
|
|
|
(declare (debug (form form))) |
|
|
|
|
`(-reduce-r (lambda (&optional it acc) ,form) ,list)) |
|
|
|
|
|
|
|
|
|
(defun -reductions-from (fn init list) |
|
|
|
|
"Return a list of the intermediate values of the reduction. |
|
|
|
|
|
|
|
|
|
See `-reduce-from' for explanation of the arguments. |
|
|
|
|
|
|
|
|
|
See also: `-reductions', `-reductions-r', `-reduce-r'" |
|
|
|
|
(nreverse (--reduce-from (cons (funcall fn (car acc) it) acc) (list init) list))) |
|
|
|
|
|
|
|
|
|
(defun -reductions (fn list) |
|
|
|
|
"Return a list of the intermediate values of the reduction. |
|
|
|
|
|
|
|
|
|
See `-reduce' for explanation of the arguments. |
|
|
|
|
|
|
|
|
|
See also: `-reductions-from', `-reductions-r', `-reduce-r'" |
|
|
|
|
(-reductions-from fn (car list) (cdr list))) |
|
|
|
|
|
|
|
|
|
(defun -reductions-r-from (fn init list) |
|
|
|
|
"Return a list of the intermediate values of the reduction. |
|
|
|
|
|
|
|
|
|
See `-reduce-r-from' for explanation of the arguments. |
|
|
|
|
|
|
|
|
|
See also: `-reductions-r', `-reductions', `-reduce'" |
|
|
|
|
(--reduce-r-from (cons (funcall fn it (car acc)) acc) (list init) list)) |
|
|
|
|
|
|
|
|
|
(defun -reductions-r (fn list) |
|
|
|
|
"Return a list of the intermediate values of the reduction. |
|
|
|
|
|
|
|
|
|
See `-reduce-r' for explanation of the arguments. |
|
|
|
|
|
|
|
|
|
See also: `-reductions-r-from', `-reductions', `-reduce'" |
|
|
|
|
(-reductions-r-from fn (-last-item list) (-butlast list))) |
|
|
|
|
|
|
|
|
|
(defmacro --filter (form list) |
|
|
|
|
"Anaphoric form of `-filter'. |
|
|
|
|
|
|
|
|
|
@ -2483,6 +2515,10 @@ structure such as plist or alist." |
|
|
|
|
"--reduce-r-from" |
|
|
|
|
"-reduce-r" |
|
|
|
|
"--reduce-r" |
|
|
|
|
"-reductions-from" |
|
|
|
|
"-reductions-r-from" |
|
|
|
|
"-reductions" |
|
|
|
|
"-reductions-r" |
|
|
|
|
"-filter" |
|
|
|
|
"--filter" |
|
|
|
|
"-select" |
|
|
|
|
|