mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-11 14:21:10 +02:00
finish transition to bare/hygiene/public/private
* module/ice-9/boot-9.scm (make-module-ref): Remove the transition support. * module/ice-9/psyntax.scm (get-global-definition-hook): Remove transition support. Also remove support for guile-macro. (build-global-reference, build-global-assignment): Remove transition support. * module/ice-9/psyntax-pp.scm: Regenerated.
This commit is contained in:
parent
a2716cbe1e
commit
d6ebfd7226
3 changed files with 20 additions and 28 deletions
|
@ -134,8 +134,8 @@
|
||||||
(define sc-macro 'sc-macro)
|
(define sc-macro 'sc-macro)
|
||||||
(define (make-module-ref mod var kind)
|
(define (make-module-ref mod var kind)
|
||||||
(case kind
|
(case kind
|
||||||
((public #t) (if mod `(@ ,mod ,var) var))
|
((public) (if mod `(@ ,mod ,var) var))
|
||||||
((private #f) (if (and mod (not (equal? mod (module-name (current-module)))))
|
((private) (if (and mod (not (equal? mod (module-name (current-module)))))
|
||||||
`(@@ ,mod ,var)
|
`(@@ ,mod ,var)
|
||||||
var))
|
var))
|
||||||
((bare) var)
|
((bare) var)
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -357,19 +357,13 @@
|
||||||
(define get-global-definition-hook
|
(define get-global-definition-hook
|
||||||
(lambda (symbol module)
|
(lambda (symbol module)
|
||||||
(let* ((module (if module
|
(let* ((module (if module
|
||||||
(resolve-module (if (memq (car module) '(#f hygiene public private bare))
|
(resolve-module (cdr module))
|
||||||
(cdr module)
|
|
||||||
module))
|
|
||||||
(let ((mod (current-module)))
|
(let ((mod (current-module)))
|
||||||
(if mod (warn "wha" symbol))
|
(if mod (warn "wha" symbol))
|
||||||
mod)))
|
mod)))
|
||||||
(v (module-variable module symbol)))
|
(v (module-variable module symbol)))
|
||||||
(and v
|
(and v (object-property v '*sc-expander*)))))
|
||||||
(or (object-property v '*sc-expander*)
|
|
||||||
(and (variable-bound? v)
|
|
||||||
(macro? (variable-ref v))
|
|
||||||
(macro-transformer (variable-ref v)) ;non-primitive
|
|
||||||
guile-macro))))))
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -404,19 +398,17 @@
|
||||||
((_ source var mod)
|
((_ source var mod)
|
||||||
(build-annotated
|
(build-annotated
|
||||||
source
|
source
|
||||||
(cond ((not mod) (make-module-ref mod var 'bare))
|
(if mod
|
||||||
((not (car mod)) (make-module-ref (cdr mod) var 'public))
|
(make-module-ref (cdr mod) var (car mod))
|
||||||
((memq (car mod) '(bare public private hygiene)) (make-module-ref (cdr mod) var (car mod)))
|
(make-module-ref mod var 'bare))))))
|
||||||
(else (make-module-ref mod var 'private)))))))
|
|
||||||
|
|
||||||
(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! ,(cond ((not mod) (make-module-ref mod var 'bare))
|
`(set! ,(if mod
|
||||||
((not (car mod)) (make-module-ref (cdr mod) var 'public))
|
(make-module-ref (cdr mod) var (car mod))
|
||||||
((memq (car mod) '(bare public private hygiene)) (make-module-ref (cdr mod) var (car mod)))
|
(make-module-ref mod var 'bare))
|
||||||
(else (make-module-ref mod var 'private)))
|
|
||||||
,exp)))))
|
,exp)))))
|
||||||
|
|
||||||
(define-syntax build-global-definition
|
(define-syntax build-global-definition
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue