projects
/
jscl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7226856
)
Define defmacro
author
David Vazquez
<davazp@gmail.com>
Sun, 16 Dec 2012 00:02:49 +0000
(
00:02
+0000)
committer
David Vazquez
<davazp@gmail.com>
Sun, 16 Dec 2012 00:02:49 +0000
(
00:02
+0000)
test.lisp
patch
|
blob
|
history
diff --git
a/test.lisp
b/test.lisp
index
54d4a63
..
86848e0
100644
(file)
--- 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)