projects
/
jscl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4ad36a3
)
!reduce
author
David Vazquez
<davazp@gmail.com>
Mon, 17 Dec 2012 00:14:58 +0000
(
00:14
+0000)
committer
David Vazquez
<davazp@gmail.com>
Mon, 17 Dec 2012 00:14:58 +0000
(
00:14
+0000)
test.lisp
patch
|
blob
|
history
diff --git
a/test.lisp
b/test.lisp
index
2f4dd35
..
eff3ac4
100644
(file)
--- a/
test.lisp
+++ b/
test.lisp
@@
-12,6
+12,7
@@
(%compile-defun ',name))
(fsetq ,name (lambda ,args ,@body))))
+(defun + (x y) (+ x y))
(defun 1+ (x) (+ x 1))
(defun 1- (x) (- x 1))
@@
-35,6
+36,13
@@
(cons (funcall func (car list))
(mapcar func (cdr list)))))
+(defun !reduce (func list initial)
+ (if (null list)
+ initial
+ (!reduce func
+ (cdr list)
+ (funcall func (car list) initial))))
+
;;; Tests
(lambda (x y) x)