diff options
author | Andy Wingo <wingo@pobox.com> | 2009-05-04 11:57:36 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2009-05-04 11:57:36 +0200 |
commit | 71f46dbd5ecf62809c2aa475b6f5742993ada0b9 (patch) | |
tree | f9aa243a579c99525027c929525ec77aa8d00b84 /module/language/scheme/compile-ghil.scm | |
parent | 123f8abb2da5ed7b2d8ccd67b3bd3532aa9d257e (diff) | |
download | guile-71f46dbd5ecf62809c2aa475b6f5742993ada0b9.tar.gz |
sc-expand in compile mode produces (ice-9 expand-support) structures
* module/ice-9/psyntax.scm (*mode*): New moving part, a fluid.
(sc-expand): Dynamically bind *mode* to the expansion mode.
(build-global-reference): Change to be a procedure instead of local
syntax. Import the logic about when to make a @ or @@ form to here,
from boot-9.scm. If we are compiling, build output using (ice-9
expand-support)'s make-module-ref, otherwise just making the familiar
s-expressions. (This will allow us to correctly expand in modules in
which @ or @@ are not bound, at least when we are compiling.)
(build-global-assignment): Use the result of build-global-reference. A
bit hacky, but hey.
(top-level-eval-hook, local-eval-hook): Strip expansion structures
before evalling.
* module/ice-9/boot-9.scm (make-module-ref): Remove, this logic is now
back in psyntax.scm.
* module/ice-9/compile-psyntax.scm (source): Since we expand in compile
mode, we need to strip expansion structures.
* module/ice-9/expand-support.scm (strip-expansion-structures): Remove
the logic about whether and how to strip @/@@ from here, as it's part
of psyntax now.
* module/ice-9/psyntax-pp.scm: Regenerated.
* module/language/scheme/compile-ghil.scm (compile-ghil): Strip expansion
structures -- for now. In the future, we might translate directly from
these structures into GHIL.
Diffstat (limited to 'module/language/scheme/compile-ghil.scm')
-rw-r--r-- | module/language/scheme/compile-ghil.scm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/module/language/scheme/compile-ghil.scm b/module/language/scheme/compile-ghil.scm index 5ff16b932..163b4b72d 100644 --- a/module/language/scheme/compile-ghil.scm +++ b/module/language/scheme/compile-ghil.scm @@ -27,6 +27,7 @@ #:use-module (system vm objcode) #:use-module (ice-9 receive) #:use-module (ice-9 optargs) + #:use-module (ice-9 expand-support) #:use-module ((system base compile) #:select (syntax-error)) #:export (compile-ghil translate-1 *translate-table* define-scheme-translator)) @@ -69,7 +70,8 @@ (and=> (cenv-module e) set-current-module) (call-with-ghil-environment (cenv-ghil-env e) '() (lambda (env vars) - (let ((x (sc-expand x 'c '(compile load eval)))) + (let ((x (strip-expansion-structures + (sc-expand x 'c '(compile load eval))))) (let ((x (make-ghil-lambda env #f vars #f '() (translate-1 env #f x))) (cenv (make-cenv (current-module) |