projects
/
jscl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b555a69
)
1+, 1-, mapcar
author
David Vazquez
<davazp@gmail.com>
Mon, 17 Dec 2012 00:05:31 +0000
(
00:05
+0000)
committer
David Vazquez
<davazp@gmail.com>
Mon, 17 Dec 2012 00:05:31 +0000
(
00:05
+0000)
test.lisp
patch
|
blob
|
history
diff --git
a/test.lisp
b/test.lisp
index
f63710a
..
2f4dd35
100644
(file)
--- a/
test.lisp
+++ b/
test.lisp
@@
-12,6
+12,9
@@
(%compile-defun ',name))
(fsetq ,name (lambda ,args ,@body))))
+(defun 1+ (x) (+ x 1))
+(defun 1- (x) (- x 1))
+
(defun append (list1 list2)
(if (null list1)
list2
@@
-26,7
+29,11
@@
(defun reverse (list)
(reverse-aux list '()))
-(debug (reverse '(1 2 3 4)))
+(defun mapcar (func list)
+ (if (null list)
+ '()
+ (cons (funcall func (car list))
+ (mapcar func (cdr list)))))
;;; Tests