summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--defun-1.lisp9
-rw-r--r--list-functions.lisp8
2 files changed, 15 insertions, 2 deletions
diff --git a/defun-1.lisp b/defun-1.lisp
index 6038e88..49680e6 100644
--- a/defun-1.lisp
+++ b/defun-1.lisp
@@ -18,3 +18,12 @@
(,env-sym (second ,arg-sym)))
(d-b ,lambda-list ,env-sym ,whole-sym ,lambda-sym
,@body)))))
+
+(%defmacro* lambda (lambda-list . body)
+ (let ((lambda-sym (gensym)))
+ `(%lambda ,lambda-sym
+ (d-b ,lambda-list nil nil ,lambda-sym
+ ,@body))))
+
+(defun funcall (function &rest arguments)
+ (apply function arguments))
diff --git a/list-functions.lisp b/list-functions.lisp
index 2622fac..3660e5e 100644
--- a/list-functions.lisp
+++ b/list-functions.lisp
@@ -2,7 +2,8 @@
eigthth ninth tenth atom consp listp null rplaca rplacd caaaar
caaadr caaar caadar caaddr caadr caar cadaar cadadr cadar
caddar cadddr caddr cadr car cdaaar cdaadr cdaar cdadar cdaddr
- cdadr cdar cddaar cddadr cddar cdddar cddddr cdddr cddr cdr))
+ cdadr cdar cddaar cddadr cddar cdddar cddddr cdddr cddr cdr
+ rest))
(%defmacro* pushq args
@@ -106,7 +107,7 @@
;;;;-----------------------------------------------------------------
-;;;; FIRST ... TENTH
+;;;; FIRST ... TENTH, REST
;;;;-----------------------------------------------------------------
(defun first (list)
(car list))
@@ -138,6 +139,9 @@
(defun tenth (list)
(car (cdddr (cdddr (cdddr list)))))
+(defun rest (list)
+ (cdr list))
+
;;;;-----------------------------------------------------------------
;;;; CONS