guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.3-212-g2f3e4


From: Mark H Weaver
Subject: [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.3-212-g2f3e436
Date: Mon, 30 Jan 2012 08:10:52 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=2f3e436411b5dbb4f1a1b9d8583b348e221d5b67

The branch, stable-2.0 has been updated
       via  2f3e436411b5dbb4f1a1b9d8583b348e221d5b67 (commit)
      from  505afe28321654a5e28b0954eeda9d1a58ce2467 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 2f3e436411b5dbb4f1a1b9d8583b348e221d5b67
Author: Mark H Weaver <address@hidden>
Date:   Mon Jan 30 03:02:32 2012 -0500

    Fix 'local-eval' when the specified environment is a module
    
    * module/ice-9/local-eval.scm (local-wrap): Fix the (module? e) case, to
      reference the expression 'x' instead of the non-existent variable
      'exp', as was previously done.  Also use quasisyntax instead of
      quasiquote, so that the introduced 'lambda' is an identifier instead
      of a bare symbol, so that this will work in modules that have rebound
      'lambda' to something else.
    
    * test-suite/tests/eval.test (local-eval): Make sure to test both
      'local-eval' and 'local-compile' when the specified environment is a
      module.

-----------------------------------------------------------------------

Summary of changes:
 module/ice-9/local-eval.scm |    2 +-
 test-suite/tests/eval.test  |   20 +++++++++++---------
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/module/ice-9/local-eval.scm b/module/ice-9/local-eval.scm
index f01a9c6..28f30b9 100644
--- a/module/ice-9/local-eval.scm
+++ b/module/ice-9/local-eval.scm
@@ -235,7 +235,7 @@
                         (scope (caddr l)))
                     (within-nested-ellipses (datum->syntax scope name) lvl)))
                 (lexenv-patterns e))))
-   ((module? e) `(lambda () #f ,exp))
+   ((module? e) #`(lambda () #f #,x))
    (else (error "invalid lexical environment" e))))
 
 (define (local-eval x e)
diff --git a/test-suite/tests/eval.test b/test-suite/tests/eval.test
index f532059..b0bfd4c 100644
--- a/test-suite/tests/eval.test
+++ b/test-suite/tests/eval.test
@@ -431,9 +431,10 @@
 
   (pass-if "local-eval"
 
-    (let* ((env1 (let ((x 1) (y 2) (z 3))
-                   (define-syntax-rule (foo x) (quote x))
-                   (the-environment)))
+    (let* ((env1 (local-eval '(let ((x 1) (y 2) (z 3))
+                                (define-syntax-rule (foo x) (quote x))
+                                (the-environment))
+                             (current-module)))
            (env2 (local-eval '(let ((x 111) (a 'a))
                                 (define-syntax-rule (bar x) (quote x))
                                 (the-environment))
@@ -448,9 +449,10 @@
 
   (pass-if "local-compile"
 
-    (let* ((env1 (let ((x 1) (y 2) (z 3))
-                   (define-syntax-rule (foo x) (quote x))
-                   (the-environment)))
+    (let* ((env1 (local-compile '(let ((x 1) (y 2) (z 3))
+                                   (define-syntax-rule (foo x) (quote x))
+                                   (the-environment))
+                                (current-module)))
            (env2 (local-compile '(let ((x 111) (a 'a))
                                    (define-syntax-rule (bar x) (quote x))
                                    (the-environment))
@@ -477,9 +479,9 @@
                      (the-environment))))
               module-a)
         (module-use! module-b (resolve-interface '(guile)))
-        (let ((env (eval `(let ((x 111) (y 222))
-                            ((@@ ,module-a-name test)))
-                         module-b)))
+        (let ((env (local-eval `(let ((x 111) (y 222))
+                                  ((@@ ,module-a-name test)))
+                               module-b)))
           (equal? (local-eval '(list x y z) env)
                   '(1 2 3))))))
 


hooks/post-receive
-- 
GNU Guile



reply via email to

[Prev in Thread] Current Thread [Next in Thread]