reference doc corrections
svn: r12650
This commit is contained in:
parent
1fa53fc4bf
commit
67f29daee5
|
@ -51,9 +51,7 @@ the grammar for @scheme[_module-path] for @scheme[require],
|
||||||
|
|
||||||
@defparam[current-module-name-resolver proc
|
@defparam[current-module-name-resolver proc
|
||||||
(case->
|
(case->
|
||||||
(resolved-module-path?
|
(resolved-module-path? . -> . any)
|
||||||
. -> .
|
|
||||||
any)
|
|
||||||
((or/c module-path? path?)
|
((or/c module-path? path?)
|
||||||
(or/c #f resolved-module-path?)
|
(or/c #f resolved-module-path?)
|
||||||
(or/c #f syntax?)
|
(or/c #f syntax?)
|
||||||
|
@ -316,35 +314,41 @@ See also @scheme[module->language-info].}
|
||||||
@;------------------------------------------------------------------------
|
@;------------------------------------------------------------------------
|
||||||
@section[#:tag "dynreq"]{Dynamic Module Access}
|
@section[#:tag "dynreq"]{Dynamic Module Access}
|
||||||
|
|
||||||
@defproc[(dynamic-require [mod module-path?][provided (or/c symbol? #f void?)])
|
@defproc[(dynamic-require [mod module-path?]
|
||||||
|
[provided (or/c symbol? #f void?)]
|
||||||
|
[fail-thunk (-> any) (lambda () ....)])
|
||||||
any]{
|
any]{
|
||||||
|
|
||||||
Dynamically instantiates the module specified by @scheme[mod] for
|
Dynamically instantiates the module specified by @scheme[mod] for
|
||||||
@tech{phase} 0 in the current namespace's registry, if it is not yet
|
@tech{phase} 0 in the current namespace's registry, if it is not yet
|
||||||
@tech{instantiate}d. If @scheme[mod] is not a symbol, the current
|
@tech{instantiate}d. The current @tech{module name resolver} may load
|
||||||
@tech{module name resolver} may load a module declaration to resolve
|
a module declaration to resolve @scheme[mod] (see
|
||||||
it (see @scheme[current-module-name-resolver]); the path is resolved
|
@scheme[current-module-name-resolver]); the path is resolved relative
|
||||||
relative to @scheme[current-load-relative-directory] and/or
|
to @scheme[current-load-relative-directory] and/or
|
||||||
@scheme[current-directory].
|
@scheme[current-directory].
|
||||||
|
|
||||||
If @scheme[provided] is @scheme[#f], then the result is @|void-const|,
|
If @scheme[provided] is @scheme[#f], then the result is @|void-const|,
|
||||||
and the module is not @tech{visit}ed (see
|
and the module is not @tech{visit}ed (see @secref["mod-parse"]).
|
||||||
@secref["mod-parse"]). Otherwise, when @scheme[provided] is a symbol,
|
|
||||||
the value of the module's export with the given name is returned, and
|
When @scheme[provided] is a symbol, the value of the module's export
|
||||||
still the module is not @tech{visit}ed. If the module exports
|
with the given name is returned, and still the module is not
|
||||||
@scheme[provide] as syntax, then a use of the binding is expanded and
|
@tech{visit}ed. If the module exports @scheme[provide] as syntax, then
|
||||||
evaluated in a fresh namespace to which the module is attached, which
|
a use of the binding is expanded and evaluated in a fresh namespace to
|
||||||
means that the module is @tech{visit}ed. If the module has no such
|
which the module is attached, which means that the module is
|
||||||
exported variable or syntax, or if the variable is protected (see
|
@tech{visit}ed. If the module has no such exported variable or syntax,
|
||||||
@secref["modprotect"]), the @exnraise[exn:fail:contract].
|
then @scheme[fail-thunk] is called; the default @scheme[fail-thunk]
|
||||||
|
raises @scheme[exn:fail:contract]. If the variable named by
|
||||||
|
@scheme[provided] is exported protected (see @secref["modprotect"]),
|
||||||
|
then the @exnraise[exn:fail:contract].
|
||||||
|
|
||||||
If @scheme[provided] is @|void-const|, then the module is
|
If @scheme[provided] is @|void-const|, then the module is
|
||||||
@tech{visit}ed but not @tech{instantiate}d (see
|
@tech{visit}ed but not @tech{instantiate}d (see @secref["mod-parse"]),
|
||||||
@secref["mod-parse"]). The result is @|void-const|.}
|
and the result is @|void-const|.}
|
||||||
|
|
||||||
|
|
||||||
@defproc[(dynamic-require-for-syntax [mod module-path?]
|
@defproc[(dynamic-require-for-syntax [mod module-path?]
|
||||||
[provided (or/c symbol? #f)])
|
[provided (or/c symbol? #f)]
|
||||||
|
[fail-thunk (-> any) (lambda () ....)])
|
||||||
any]{
|
any]{
|
||||||
|
|
||||||
Like @scheme[dynamic-require], but in @tech{phase} 1.}
|
Like @scheme[dynamic-require], but in @tech{phase} 1.}
|
||||||
|
|
|
@ -396,14 +396,16 @@ exports of the module.
|
||||||
@defproc[(syntax-local-get-shadower [id-stx identifier?]) identifier?]{
|
@defproc[(syntax-local-get-shadower [id-stx identifier?]) identifier?]{
|
||||||
|
|
||||||
Returns @scheme[id-stx] if no binding in the current expansion context
|
Returns @scheme[id-stx] if no binding in the current expansion context
|
||||||
shadows @scheme[id-stx], if @scheme[id-stx] has no module bindings in
|
shadows @scheme[id-stx] (ignoring unsealed @tech{internal-definition
|
||||||
its lexical information, and if the current expansion context is not a
|
contexts}), if @scheme[id-stx] has no module bindings in its lexical
|
||||||
|
information, and if the current expansion context is not a
|
||||||
@tech{module context}.
|
@tech{module context}.
|
||||||
|
|
||||||
If a binding of @scheme[inner-identifier] shadows @scheme[id-stx], the
|
If a binding of @scheme[inner-identifier] shadows @scheme[id-stx], the
|
||||||
result is the same as
|
result is the same as @scheme[(syntax-local-get-shadower
|
||||||
@scheme[(syntax-local-get-shadower inner-identifier)], except that it
|
inner-identifier)], except that it has the location and properties of
|
||||||
has the location and properties of @scheme[id-stx].
|
@scheme[id-stx]. When searching for a shadowing binding, bindings from
|
||||||
|
unsealed @tech{internal-definition contexts} are ignored.
|
||||||
|
|
||||||
Otherwise, the result is the same as @scheme[id-stx] with its module
|
Otherwise, the result is the same as @scheme[id-stx] with its module
|
||||||
bindings (if any) removed from its lexical information, and the
|
bindings (if any) removed from its lexical information, and the
|
||||||
|
@ -473,7 +475,7 @@ mark}. Multiple applications of the same
|
||||||
and different result procedures use distinct marks.}
|
and different result procedures use distinct marks.}
|
||||||
|
|
||||||
@defproc[(make-syntax-delta-introducer [ext-stx syntax?]
|
@defproc[(make-syntax-delta-introducer [ext-stx syntax?]
|
||||||
[base-stx syntax?]
|
[base-stx (or/c syntax? #f)]
|
||||||
[phase-level (or/c #f exact-integer?)
|
[phase-level (or/c #f exact-integer?)
|
||||||
(syntax-local-phase-level)])
|
(syntax-local-phase-level)])
|
||||||
(syntax? . -> . syntax?)]{
|
(syntax? . -> . syntax?)]{
|
||||||
|
@ -482,10 +484,10 @@ Produces a procedure that behaves like
|
||||||
@scheme[syntax-local-introduce], but using the @tech{syntax marks} of
|
@scheme[syntax-local-introduce], but using the @tech{syntax marks} of
|
||||||
@scheme[ext-stx] that are not shared with @scheme[base-stx]. If
|
@scheme[ext-stx] that are not shared with @scheme[base-stx]. If
|
||||||
@scheme[ext-stx] does not extend the set of marks in @scheme[base-stx]
|
@scheme[ext-stx] does not extend the set of marks in @scheme[base-stx]
|
||||||
but @scheme[ext-stx] has a module binding in the @tech{phase level}
|
or if @scheme[base-stx] is @scheme[#f], and if @scheme[ext-stx] has a
|
||||||
indicated by @scheme[phase-level], then any marks of @scheme[ext-stx]
|
module binding in the @tech{phase level} indicated by
|
||||||
that would be needed to preserve its binding are not transferred in an
|
@scheme[phase-level], then any marks of @scheme[ext-stx] that would be
|
||||||
introduction.
|
needed to preserve its binding are not transferred in an introduction.
|
||||||
|
|
||||||
This procedure is potentially useful when @scheme[_m-id] has a
|
This procedure is potentially useful when @scheme[_m-id] has a
|
||||||
transformer binding that records some @scheme[_orig-id], and a use of
|
transformer binding that records some @scheme[_orig-id], and a use of
|
||||||
|
|
Loading…
Reference in New Issue
Block a user