cwebber pushed a commit to branch wip-elisp-rebased
in repository guile.

commit 8d26ce3f0c7ae5c8c0b8c2c9782565ff660a8ee9
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 Christopher Allan 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))))
 

Reply via email to