document `define-runtime-path' limitation
Also, log a warning when it is used in a position where it doesn't work rght with the executable creator. I didn't make this case an error, because `define-runtime-path' can still work in that case as long as no standalone executable needs to be created.
This commit is contained in:
parent
a6cfe3d5fb
commit
50af874a7a
|
@ -158,6 +158,12 @@
|
||||||
#'orig-stx
|
#'orig-stx
|
||||||
id)))
|
id)))
|
||||||
ids)
|
ids)
|
||||||
|
(let ([phase (sub1 (variable-reference->phase (#%variable-reference)))])
|
||||||
|
(unless (zero? phase)
|
||||||
|
(log-warning "warning: ~a: at phase level ~a: ~e"
|
||||||
|
(syntax-e (syntax-case #'orig-stx () [(id . _) #'id]))
|
||||||
|
phase
|
||||||
|
#'orig-stx)))
|
||||||
#`(begin
|
#`(begin
|
||||||
(define-values (id ...)
|
(define-values (id ...)
|
||||||
(let-values ([(id ...) expr])
|
(let-values ([(id ...) expr])
|
||||||
|
|
|
@ -536,6 +536,15 @@ If a path is needed only on some platforms and not on others, use
|
||||||
@racket[define-runtime-path-list] with an @racket[expr] that produces an
|
@racket[define-runtime-path-list] with an @racket[expr] that produces an
|
||||||
empty list on platforms where the path is not needed.
|
empty list on platforms where the path is not needed.
|
||||||
|
|
||||||
|
Beware that @racket[define-runtime-path] in a @tech{phase level} other
|
||||||
|
than 0 does not cooperate properly with an executable creator. To work
|
||||||
|
around that limitation, put @racket[define-runtime-path] in a separate
|
||||||
|
module---perhaps a @tech{submodule} created by @racket[module]---then
|
||||||
|
export the definition, and then the module containing the definition
|
||||||
|
can be @racket[require]d into any phase level. Using
|
||||||
|
@racket[define-runtime-path] in a @tech{phase level} other than 0
|
||||||
|
logs a warning at expansion time.
|
||||||
|
|
||||||
The enclosing path for a @racket[define-runtime-path] is determined as
|
The enclosing path for a @racket[define-runtime-path] is determined as
|
||||||
follows from the @racket[define-runtime-path] syntactic form:
|
follows from the @racket[define-runtime-path] syntactic form:
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user