From 4ad36a3415efc56d1348f9c705b6c436ed488a3f Mon Sep 17 00:00:00 2001 From: David Vazquez Date: Mon, 17 Dec 2012 00:05:31 +0000 Subject: [PATCH] 1+, 1-, mapcar --- test.lisp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test.lisp b/test.lisp index f63710a..2f4dd35 100644 --- 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 -- 1.7.10.4