1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-14 23:50:19 +02:00

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!
This commit is contained in:
Andy Wingo 2009-04-23 13:30:23 +02:00
parent c5ad45c7b3
commit 01c161ca11
5 changed files with 31 additions and 47 deletions

View file

@ -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)