summaryrefslogtreecommitdiff
path: root/module/language/scheme/compile-ghil.scm
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2009-04-23 13:30:23 +0200
committerAndy Wingo <wingo@pobox.com>2009-04-24 14:25:45 +0200
commit01c161ca11b19d56ce994cba477a8fc4aeb8ac43 (patch)
treee1d4cdbfa50e3ee2bc05f8e63847f39c805991d7 /module/language/scheme/compile-ghil.scm
parentc5ad45c7b34346f0f7084477479e7367c30a67f6 (diff)
downloadguile-01c161ca11b19d56ce994cba477a8fc4aeb8ac43.tar.gz
it is alive!!!!! + concision + fix to compile-ghil
* module/ice-9/boot-9.scm: Remove lots of debugging prints. Remove some already-deprecated attempts to load modules from shared libraries. * module/ice-9/psyntax.scm: If we have to create a variable for a syntactic binding, initialize its contents to a gensym. I'd like something more meaningful, but at least this way we can tell different macros apart. Only warn about missing modules if modules are booted. Chi the value part of a (set! (@ ...) ) expression -- whoops! * module/ice-9/psyntax-pp.scm: Regenerated. * module/language/glil.scm (parse-glil): Fix an unquoting error. * module/language/scheme/compile-ghil.scm: No need to import syncase, we gots it. Rework compiler to expand only once, with syncase, instead of incrementally. Fix define-scheme-transformer to work with syncase, by not referencing bare keywords. It works!
Diffstat (limited to 'module/language/scheme/compile-ghil.scm')
-rw-r--r--module/language/scheme/compile-ghil.scm33
1 files changed, 9 insertions, 24 deletions
diff --git a/module/language/scheme/compile-ghil.scm b/module/language/scheme/compile-ghil.scm
index 86234059e..45d6c204f 100644
--- a/module/language/scheme/compile-ghil.scm
+++ b/module/language/scheme/compile-ghil.scm
@@ -27,12 +27,11 @@
#:use-module (system vm objcode)
#:use-module (ice-9 receive)
#:use-module (ice-9 optargs)
- #:use-module (ice-9 expand-support)
- #:use-module ((ice-9 syncase) #:select (sc-macro))
#:use-module ((system base compile) #:select (syntax-error))
#:export (compile-ghil translate-1
*translate-table* define-scheme-translator))
+(module-ref (current-module) 'receive)
;;; environment := #f
;;; | MODULE
@@ -70,12 +69,13 @@
(and=> (cenv-module e) set-current-module)
(call-with-ghil-environment (cenv-ghil-env e) '()
(lambda (env vars)
- (let ((x (make-ghil-lambda env #f vars #f '()
- (translate-1 env #f x)))
- (cenv (make-cenv (current-module)
- (ghil-env-parent env)
- (if e (cenv-externals e) '()))))
- (values x cenv cenv)))))))
+ (let ((x (sc-expand3 x 'c '(compile load eval))))
+ (let ((x (make-ghil-lambda env #f vars #f '()
+ (translate-1 env #f x)))
+ (cenv (make-cenv (current-module)
+ (ghil-env-parent env)
+ (if e (cenv-externals e) '()))))
+ (values x cenv cenv))))))))
;;;
@@ -104,9 +104,6 @@
(let* ((mod (current-module))
(val (cond
((symbol? head) (module-ref/safe mod head))
- ;; allow macros to be unquoted into the output of a macro
- ;; expansion
- ((macro? head) head)
((pmatch head
((@ ,modname ,sym)
(module-ref/safe (resolve-interface modname) sym))
@@ -117,18 +114,6 @@
(cond
((hashq-ref *translate-table* val))
- ((defmacro? val)
- (lambda (env loc exp)
- (retrans (apply (defmacro-transformer val) (cdr exp)))))
-
- ((eq? val sc-macro)
- ;; syncase!
- (let ((sc-expand3 (@@ (ice-9 syncase) sc-expand3)))
- (lambda (env loc exp)
- (retrans
- (strip-expansion-structures
- (sc-expand3 exp 'c '(compile load eval)))))))
-
((primitive-macro? val)
(syntax-error #f "unhandled primitive macro" head))
@@ -180,7 +165,7 @@
(define-macro (define-scheme-translator sym . clauses)
`(hashq-set! (@ (language scheme compile-ghil) *translate-table*)
- ,sym
+ (module-ref (current-module) ',sym)
(lambda (e l exp)
(define (retrans x)
((@ (language scheme compile-ghil) translate-1)