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:
parent
7c72fe0bb5
commit
384e92b3ae
4 changed files with 23 additions and 20 deletions
|
@ -135,7 +135,7 @@
|
||||||
(define (make-module-ref mod var public?)
|
(define (make-module-ref mod var public?)
|
||||||
(cond
|
(cond
|
||||||
((or (not mod)
|
((or (not mod)
|
||||||
(eq? mod (module-name (current-module)))
|
(equal? mod (module-name (current-module)))
|
||||||
(and (not public?)
|
(and (not public?)
|
||||||
(not (module-variable (resolve-module mod) var))))
|
(not (module-variable (resolve-module mod) var))))
|
||||||
var)
|
var)
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -406,14 +406,20 @@
|
||||||
(define-syntax build-global-reference
|
(define-syntax build-global-reference
|
||||||
(syntax-rules ()
|
(syntax-rules ()
|
||||||
((_ source var mod)
|
((_ source var mod)
|
||||||
(build-annotated source
|
(cond
|
||||||
(make-module-ref mod var #f)))))
|
((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
|
(define-syntax build-global-assignment
|
||||||
(syntax-rules ()
|
(syntax-rules ()
|
||||||
((_ source var exp mod)
|
((_ source var exp mod)
|
||||||
(build-annotated source
|
(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
|
(define-syntax build-global-definition
|
||||||
(syntax-rules ()
|
(syntax-rules ()
|
||||||
|
@ -1801,12 +1807,12 @@
|
||||||
|
|
||||||
(global-extend 'module-ref '@
|
(global-extend 'module-ref '@
|
||||||
(lambda (e)
|
(lambda (e)
|
||||||
(syntax-case e (%module-public-interface)
|
(syntax-case e ()
|
||||||
((_ (mod ...) id)
|
((_ (mod ...) id)
|
||||||
(and (andmap id? (syntax (mod ...))) (id? (syntax id)))
|
(and (andmap id? (syntax (mod ...))) (id? (syntax id)))
|
||||||
(values (syntax-object->datum (syntax id))
|
(values (syntax-object->datum (syntax id))
|
||||||
(syntax-object->datum
|
(syntax-object->datum
|
||||||
(syntax (mod ... %module-public-interface))))))))
|
(syntax (#f mod ...))))))))
|
||||||
|
|
||||||
(global-extend 'module-ref '@@
|
(global-extend 'module-ref '@@
|
||||||
(lambda (e)
|
(lambda (e)
|
||||||
|
|
|
@ -114,9 +114,6 @@
|
||||||
(cond
|
(cond
|
||||||
((hashq-ref *translate-table* val))
|
((hashq-ref *translate-table* val))
|
||||||
|
|
||||||
((primitive-macro? val)
|
|
||||||
(syntax-error #f "unhandled primitive macro" head))
|
|
||||||
|
|
||||||
((macro? val)
|
((macro? val)
|
||||||
(syntax-error #f "unknown kind of macro" head))
|
(syntax-error #f "unknown kind of macro" head))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue