* (ikarus) now exports the "library" keyword, allowing (library ---)
forms to appear anywhere definitions can appear including the top-level, body of a script, body of a library, or body of a function.
This commit is contained in:
parent
de369b3497
commit
6e7e0410fb
|
@ -102,6 +102,7 @@
|
||||||
'([define (define)]
|
'([define (define)]
|
||||||
[define-syntax (define-syntax)]
|
[define-syntax (define-syntax)]
|
||||||
[module (module)]
|
[module (module)]
|
||||||
|
[library (library)]
|
||||||
[begin (begin)]
|
[begin (begin)]
|
||||||
[import (import)]
|
[import (import)]
|
||||||
[set! (set!)]
|
[set! (set!)]
|
||||||
|
@ -1269,6 +1270,7 @@
|
||||||
[pretty-print i $boot]
|
[pretty-print i $boot]
|
||||||
[pretty-width i]
|
[pretty-width i]
|
||||||
[module i cm]
|
[module i cm]
|
||||||
|
[library i]
|
||||||
[syntax-dispatch ]
|
[syntax-dispatch ]
|
||||||
[syntax-error i r sc]
|
[syntax-error i r sc]
|
||||||
[$transcoder? $transc]
|
[$transcoder? $transc]
|
||||||
|
|
|
@ -538,7 +538,8 @@
|
||||||
(case type
|
(case type
|
||||||
((lexical core-prim macro macro! global local-macro
|
((lexical core-prim macro macro! global local-macro
|
||||||
local-macro! global-macro global-macro!
|
local-macro! global-macro global-macro!
|
||||||
displaced-lexical syntax import $module $core-rtd)
|
displaced-lexical syntax import $module $core-rtd
|
||||||
|
library)
|
||||||
(values type (binding-value b) id))
|
(values type (binding-value b) id))
|
||||||
(else (values 'other #f #f))))))
|
(else (values 'other #f #f))))))
|
||||||
((syntax-pair? e)
|
((syntax-pair? e)
|
||||||
|
@ -552,7 +553,7 @@
|
||||||
(case type
|
(case type
|
||||||
((define define-syntax core-macro begin macro
|
((define define-syntax core-macro begin macro
|
||||||
macro! local-macro local-macro! global-macro
|
macro! local-macro local-macro! global-macro
|
||||||
global-macro! module set! let-syntax
|
global-macro! module library set! let-syntax
|
||||||
letrec-syntax import $core-rtd)
|
letrec-syntax import $core-rtd)
|
||||||
(values type (binding-value b) id))
|
(values type (binding-value b) id))
|
||||||
(else
|
(else
|
||||||
|
@ -2359,7 +2360,7 @@
|
||||||
((displaced-lexical)
|
((displaced-lexical)
|
||||||
(stx-error e "identifier out of context"))
|
(stx-error e "identifier out of context"))
|
||||||
((syntax) (stx-error e "reference to pattern variable outside a syntax form"))
|
((syntax) (stx-error e "reference to pattern variable outside a syntax form"))
|
||||||
((define define-syntax module import)
|
((define define-syntax module import library)
|
||||||
(stx-error e "invalid expression"))
|
(stx-error e "invalid expression"))
|
||||||
(else
|
(else
|
||||||
;(error 'chi-expr "invalid type " type (strip e '()))
|
;(error 'chi-expr "invalid type " type (strip e '()))
|
||||||
|
@ -2596,6 +2597,9 @@
|
||||||
(lambda (id lab) (extend-rib! rib id lab))
|
(lambda (id lab) (extend-rib! rib id lab))
|
||||||
m-exp-id* m-exp-lab*)
|
m-exp-id* m-exp-lab*)
|
||||||
(chi-body* (cdr e*) r mr lex* rhs* mod** kwd* rib top?)))
|
(chi-body* (cdr e*) r mr lex* rhs* mod** kwd* rib top?)))
|
||||||
|
((library)
|
||||||
|
((current-library-expander) (stx->datum e))
|
||||||
|
(chi-body* (cdr e*) r mr lex* rhs* mod** kwd* rib top?))
|
||||||
((import)
|
((import)
|
||||||
(let ()
|
(let ()
|
||||||
(define (module-import e r)
|
(define (module-import e r)
|
||||||
|
@ -2687,6 +2691,9 @@
|
||||||
(chi-top* (cons (chi-local-macro value e) (cdr e*)) init*))
|
(chi-top* (cons (chi-local-macro value e) (cdr e*)) init*))
|
||||||
((macro macro!)
|
((macro macro!)
|
||||||
(chi-top* (cons (chi-macro value e) (cdr e*)) init*))
|
(chi-top* (cons (chi-macro value e) (cdr e*)) init*))
|
||||||
|
((library)
|
||||||
|
((current-library-expander) (stx->datum e))
|
||||||
|
(chi-top* (cdr e*) init*))
|
||||||
(else
|
(else
|
||||||
(chi-top* (cdr e*)
|
(chi-top* (cdr e*)
|
||||||
(cons (cons #f (chi-expr e '() '()))
|
(cons (cons #f (chi-expr e '() '()))
|
||||||
|
|
Loading…
Reference in New Issue