summaryrefslogtreecommitdiff
path: root/module/language/scheme/compile-ghil.scm
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2009-04-16 15:20:40 +0200
committerAndy Wingo <wingo@pobox.com>2009-04-16 15:20:40 +0200
commitb41b92c9d1c439ddfc5c081b3949e9d1763de181 (patch)
tree5b24839cf3c6ff8b69140f020b0f9499dbd28369 /module/language/scheme/compile-ghil.scm
parent275baf01136895093570725fe55c4104725a9387 (diff)
downloadguile-b41b92c9d1c439ddfc5c081b3949e9d1763de181.tar.gz
compilation passes return third value: the continuation environment
* module/system/base/compile.scm: Expect compile passes to produce three values, not two. The third is the "continuation environment", the environment that can be used to compile a subsequent expression from the same source language. For example, expansion-time side effects can set the current module, which would be reflected appropriately in the continuation environment. * module/language/assembly/compile-bytecode.scm: * module/language/bytecode/spec.scm: * module/language/ecmascript/compile-ghil.scm: * module/language/ghil/compile-glil.scm: * module/language/glil/spec.scm: * module/language/objcode/spec.scm: * module/language/scheme/compile-ghil.scm: * module/system/base/compile.scm: Update compile passes to return a continuation environment.
Diffstat (limited to 'module/language/scheme/compile-ghil.scm')
-rw-r--r--module/language/scheme/compile-ghil.scm15
1 files changed, 10 insertions, 5 deletions
diff --git a/module/language/scheme/compile-ghil.scm b/module/language/scheme/compile-ghil.scm
index 587a173fe..f1816e18c 100644
--- a/module/language/scheme/compile-ghil.scm
+++ b/module/language/scheme/compile-ghil.scm
@@ -56,6 +56,8 @@
((pair? env) (cddr env))
(else (error "bad environment" env))))
+(define (make-cenv module lexicals externals)
+ (cons module (cons lexicals externals)))
@@ -65,11 +67,14 @@
(and=> (cenv-module e) set-current-module)
(call-with-ghil-environment (cenv-ghil-env e) '()
(lambda (env vars)
- (values (make-ghil-lambda env #f vars #f '() (translate-1 env #f x))
- (and e
- (cons* (cenv-module e)
- (ghil-env-parent env)
- (cenv-externals e)))))))))
+ (let ((x (make-ghil-lambda env #f vars #f '()
+ (translate-1 env #f x))))
+ (values x
+ (and e
+ (cons* (cenv-module e)
+ (ghil-env-parent env)
+ (cenv-externals e)))
+ (make-cenv (current-module) '() '()))))))))
;;;