1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

fix @ and syncase

* module/ice-9/boot-9.scm
  (make-module-ref): equal?, not eq?, when matching on module name.
  (Module names don't have to come from an invocation of module-name in
  this process.)

* module/ice-9/psyntax.scm (build-global-reference)
  (build-global-assignment, @): Rework the format of the module in syntax
  objects so that a car of #f indicates a public reference. Loading (foo
  %module-public-interface) didn't guarantee that (foo) was loaded and
  useful.

* module/ice-9/psyntax-pp.scm: Regenerated.

* module/language/scheme/compile-ghil.scm (lookup-transformer):
  primitive-macro? does not exist any more.
This commit is contained in:
Andy Wingo 2009-04-24 12:12:24 +02:00
parent 7c72fe0bb5
commit 384e92b3ae
4 changed files with 23 additions and 20 deletions

View file

@ -135,7 +135,7 @@
(define (make-module-ref mod var public?)
(cond
((or (not mod)
(eq? mod (module-name (current-module)))
(equal? mod (module-name (current-module)))
(and (not public?)
(not (module-variable (resolve-module mod) var))))
var)

File diff suppressed because one or more lines are too long

View file

@ -406,14 +406,20 @@
(define-syntax build-global-reference
(syntax-rules ()
((_ source var mod)
(build-annotated source
(make-module-ref mod var #f)))))
(cond
((and mod (not (car mod)))
(build-annotated source (make-module-ref (cdr mod) var #t)))
(else
(build-annotated source (make-module-ref mod var #f)))))))
(define-syntax build-global-assignment
(syntax-rules ()
((_ source var exp mod)
(build-annotated source
`(set! ,(make-module-ref mod var #f) ,exp)))))
`(set! ,(cond
((and mod (not (car mod))) (make-module-ref (cdr mod) var #t))
(else (make-module-ref mod var #f)))
,exp)))))
(define-syntax build-global-definition
(syntax-rules ()
@ -1801,12 +1807,12 @@
(global-extend 'module-ref '@
(lambda (e)
(syntax-case e (%module-public-interface)
(syntax-case e ()
((_ (mod ...) id)
(and (andmap id? (syntax (mod ...))) (id? (syntax id)))
(values (syntax-object->datum (syntax id))
(syntax-object->datum
(syntax (mod ... %module-public-interface))))))))
(syntax (#f mod ...))))))))
(global-extend 'module-ref '@@
(lambda (e)

View file

@ -114,9 +114,6 @@
(cond
((hashq-ref *translate-table* val))
((primitive-macro? val)
(syntax-error #f "unhandled primitive macro" head))
((macro? val)
(syntax-error #f "unknown kind of macro" head))