1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-13 17:20:21 +02:00

commit some tweaks to expand.scm, likely obviated by syncase though

* module/language/scheme/expand.scm (re-annotate, expand): A couple of
  speculative cases for dealing with syncase better -- but all of this
  code is likely to go.
This commit is contained in:
Andy Wingo 2009-03-09 20:52:45 +01:00
parent b7e6589fff
commit ae6bba7f9c

View file

@ -37,7 +37,7 @@
(define (acddr x) (acdr (acdr x))) (define (acddr x) (acdr (acdr x)))
(define (aloc x) (and (annotation? x) (annotation-source x))) (define (aloc x) (and (annotation? x) (annotation-source x)))
(define (re-annotate x y) (define (re-annotate x y)
(if (annotation? x) (if (and (annotation? x) (not (annotation? y)))
(make-annotation y (annotation-source x)) (make-annotation y (annotation-source x))
y)) y))
(define-macro (-> exp) `(re-annotate x ,exp)) (define-macro (-> exp) `(re-annotate x ,exp))
@ -77,8 +77,8 @@
(sc-expand3 (@@ (ice-9 syncase) sc-expand3))) (sc-expand3 (@@ (ice-9 syncase) sc-expand3)))
(re-expand (re-expand
(with-fluids ((eec (module-eval-closure mod))) (with-fluids ((eec (module-eval-closure mod)))
;; fixme ;; fixme -- use ewes fluid?
(sc-expand3 (deannotate exp) 'c '(compile load eval)))))) (sc-expand3 exp 'c '(compile load eval))))))
((primitive-macro? val) ((primitive-macro? val)
(syntax-error (aloc x) "unhandled primitive macro" head)) (syntax-error (aloc x) "unhandled primitive macro" head))