cwebber pushed a commit to branch wip-elisp-rebased
in repository guile.
commit 31761a62217b2ffe67f9f391582026cce456fe3a
Author: Robin Templeton <[email protected]>
AuthorDate: Mon Aug 11 06:04:28 2014 -0400
only evaluate top-level macro definitions
(Best-ability ChangeLog annotation added by Christine Lemmer-Webber.)
* module/language/elisp/compile-tree-il.scm (defmacro): Check to see
whether toplevel? is true before compiling a macro.
---
module/language/elisp/compile-tree-il.scm | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/module/language/elisp/compile-tree-il.scm
b/module/language/elisp/compile-tree-il.scm
index 29c769d..6c3f7bd 100644
--- a/module/language/elisp/compile-tree-il.scm
+++ b/module/language/elisp/compile-tree-il.scm
@@ -786,9 +786,10 @@
args
body))))
(make-const loc name))))
- (with-native-target
- (lambda ()
- (compile tree-il #:from 'tree-il #:to 'value)))
+ (when (fluid-ref toplevel?)
+ (with-native-target
+ (lambda ()
+ (compile tree-il #:from 'tree-il #:to 'value))))
tree-il)))
(else (report-error loc "bad defmacro" args))))