Permalink
Browse files

I love the smell of eval-when in the morning

darcs-hash:20080901165040-3cc5d-7c21bf615246c782295a1f61273f85a5425a327f.gz
  • Loading branch information...
1 parent cde6d07 commit 0b548188cdf9e91c0c12503c9c236f5a790b1050 @gwkkwg committed Sep 1, 2008
Showing with 4 additions and 2 deletions.
  1. +4 −2 dev/l0-macros.lisp
View
@@ -41,6 +41,7 @@ at compile time whereever foo-1 is used."
(values form))
,@body)))
+(eval-when (:compile-toplevel :load-toplevel :evaluate)
(defmacro once-only (variable-list &body body)
"Generate code that evaluates certain expressions only once.
This is used in macros, for computing expansions.
@@ -82,7 +83,7 @@ Example:
(if (null ,bind-vars)
result
`((lambda
- ,(nreverse ,bind-vars) ,result) . ,(nreverse ,bind-vals)))))))
+ ,(nreverse ,bind-vars) ,result) . ,(nreverse ,bind-vals))))))))
(defmacro with-variables (symbols &body body)
"Using gensyms is necessary to prevent variables produced by macro expansions
@@ -174,11 +175,12 @@ i.e. so you usually fix the problem and then call retry."
(handler-bind ,binds
(:retry))))))
+(eval-when (:compile-toplevel :load-toplevel :evaluate)
(defmacro with-gensyms (syms &body body)
`(let ,(mapcar #'(lambda (s)
`(,s (gensym)))
syms)
- ,@body))
+ ,@body)))
(defvar *file-if-exists* :supersede

0 comments on commit 0b54818

Please sign in to comment.