From: David Vazquez Date: Sun, 16 Dec 2012 00:02:49 +0000 (+0000) Subject: Define defmacro X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=95108b1375281d198995c902c700a66b7bc9c6a3;p=jscl.git Define defmacro --- diff --git a/test.lisp b/test.lisp index 54d4a63..86848e0 100644 --- a/test.lisp +++ b/test.lisp @@ -34,3 +34,17 @@ (setq x 0) (incf x) (debug x) + +(eval-when-compile + (%compile-defmacro 'defmacro + (lambda (name args &rest body) + (list 'eval-when-compile + (list '%compile-defmacro (list 'quote name) + (list* 'lambda args body)))))) + +(defmacro %incf (x) + (list 'setq x (list '+ 1 x))) + +(setq x 10) +(%incf x) +(debug x)