diff options
author | Matthias Andreas Benkard <matthias@benkard.de> | 2008-07-27 18:19:33 +0200 |
---|---|---|
committer | Matthias Andreas Benkard <matthias@benkard.de> | 2008-07-27 18:19:33 +0200 |
commit | 0d52c58f1e8941c4c08182710abcb327489b8c99 (patch) | |
tree | 5d314d9f58fe3d09f18b9475cb18273acd0024c2 /defun-1.lisp | |
parent | ea2bddd8ab02ec50b3feb103bd9e698c64bc423f (diff) |
Use DEFUN in order to redefine functions used to implement DEFUN after it has been defined itself.
Diffstat (limited to 'defun-1.lisp')
-rw-r--r-- | defun-1.lisp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/defun-1.lisp b/defun-1.lisp new file mode 100644 index 0000000..a0c2416 --- /dev/null +++ b/defun-1.lisp @@ -0,0 +1,20 @@ +(%defmacro* defun (name lambda-list . body) + (let ((lambda-sym (gensym))) + `(%defun ,name ,lambda-sym + (d-b ,lambda-list nil nil ,lambda-sym + ,@body)))) + +(%defmacro* defmacro (name lambda-list . body) + (let ((arg-sym (gensym)) + (lambda-sym (gensym)) + (whole-sym (gensym)) + (env-sym (gensym))) + `(%defmacro ,name ,arg-sym + (let ((,whole-sym (first ,arg-sym)) + (,lambda-sym (cdr (first ,arg-sym))) + (,env-sym (second ,arg-sym))) + (d-b ,lambda-list ,env-sym ,whole-sym ,lambda-sym + ,@body))))) + + +(export '(defmacro defun)) |