|
|
|
@ -107,9 +107,11 @@ exposed as `acc`." |
|
|
|
|
|
|
|
|
|
|
|
(defmacro --reduce (form list) |
|
|
|
(defmacro --reduce (form list) |
|
|
|
"Anaphoric form of `-reduce'." |
|
|
|
"Anaphoric form of `-reduce'." |
|
|
|
(if (eval list) |
|
|
|
(let ((lv (make-symbol "list-value"))) |
|
|
|
`(--reduce-from ,form ,(car (eval list)) ',(cdr (eval list))) |
|
|
|
`(let ((,lv ,list)) |
|
|
|
`(let (acc it) ,form))) |
|
|
|
(if ,lv |
|
|
|
|
|
|
|
(--reduce-from ,form (car ,lv) (cdr ,lv)) |
|
|
|
|
|
|
|
(let (acc it) ,form))))) |
|
|
|
|
|
|
|
|
|
|
|
(defun -reduce (fn list) |
|
|
|
(defun -reduce (fn list) |
|
|
|
"Returns the result of applying FN to the first 2 items in LIST, |
|
|
|
"Returns the result of applying FN to the first 2 items in LIST, |
|
|
|
|