~ chicken-core (chicken-5) 98259ae99912d3c7883cb32bfa2e51252ec02e4e


commit 98259ae99912d3c7883cb32bfa2e51252ec02e4e
Author:     felix <felix@call-with-current-continuation.org>
AuthorDate: Mon Jul 4 12:13:59 2011 +0200
Commit:     felix <felix@call-with-current-continuation.org>
CommitDate: Mon Jul 4 12:13:59 2011 +0200

    make active-eval-env a parameter

diff --git a/eval.scm b/eval.scm
index 33b67b6c..c7580a5e 100644
--- a/eval.scm
+++ b/eval.scm
@@ -794,12 +794,12 @@
   (let ((oldcm (##sys#current-module))
 	(oldme (##sys#macro-environment))
 	(mme (##sys#meta-macro-environment))
-	(aee ##sys#active-eval-environment))
+	(aee (##sys#active-eval-environment)))
     (dynamic-wind
 	(lambda () 
 	  (##sys#current-module #f)
 	  (##sys#macro-environment mme)
-	  (set! ##sys#active-eval-environment ##sys#current-meta-environment))
+	  (##sys#active-eval-environment ##sys#current-meta-environment))
 	(lambda ()
 	  ((##sys#compile-to-closure
 	    form
@@ -807,7 +807,7 @@
 	    (##sys#current-meta-environment))
 	   '() ) )
 	(lambda ()
-	  (set! ##sys#active-eval-environment aee)
+	  (##sys#active-eval-environment aee)
 	  (##sys#current-module oldcm)
 	  (##sys#meta-macro-environment (##sys#macro-environment))
 	  (##sys#macro-environment oldme)))))
diff --git a/expand.scm b/expand.scm
index 6747135a..550c1b09 100644
--- a/expand.scm
+++ b/expand.scm
@@ -60,9 +60,8 @@
 (define ##sys#current-environment (make-parameter '()))
 (define ##sys#current-meta-environment (make-parameter '()))
 
-;;XXX should this be a parameter?
 ;;XXX should this be in eval.scm?
-(define ##sys#active-eval-environment ##sys#current-environment)
+(define ##sys#active-eval-environment (make-parameter ##sys#current-environment))
 
 (define (lookup id se)
   (cond ((##core#inline "C_u_i_assq" id se) => cdr)
diff --git a/modules.scm b/modules.scm
index 9bdd7dbc..c38323c0 100644
--- a/modules.scm
+++ b/modules.scm
@@ -718,7 +718,7 @@
 	((getp sym '##core#aliased) 
 	 (dm "(ALIAS) marked: " sym)
 	 sym)
-	((assq sym (##sys#active-eval-environment)) =>
+	((assq sym ((##sys#active-eval-environment))) =>
 	 (lambda (a)
 	   (let ((sym2 (cdr a)))
 	     (dm "(ALIAS) in current environment " sym " -> " sym2)
Trap