change module-path?' to subsume path?'

Although th eoriginal idea was to distinguish "text" paths
from derived filesystem paths, practically everythign that accepts
a module path also accepts a path. Building the generalization into
`module-path?' makes it easier to support `submod' wrappers on paths,
and it seems to fix things rather than break them.
This commit is contained in:
Matthew Flatt 2012-03-12 20:32:08 -06:00
parent 060515b9cd
commit facc8db712
8 changed files with 135 additions and 145 deletions

View File

@ -47,13 +47,14 @@ Returns the path or symbol encapsulated by a @tech{resolved module path}.}
Returns @racket[#t] if @racket[v] corresponds to a datum that matches Returns @racket[#t] if @racket[v] corresponds to a datum that matches
the grammar for @racket[_module-path] for @racket[require], the grammar for @racket[_module-path] for @racket[require],
@racket[#f] otherwise.} @racket[#f] otherwise. Note that a path (in the sense of
@racket[path?]) is a module path.}
@defparam[current-module-name-resolver proc @defparam[current-module-name-resolver proc
(case-> (case->
(resolved-module-path? . -> . any) (resolved-module-path? . -> . any)
((or/c module-path? path?) (module-path?
(or/c #f resolved-module-path?) (or/c #f resolved-module-path?)
(or/c #f syntax?) (or/c #f syntax?)
boolean? boolean?
@ -220,7 +221,7 @@ resolved name can depend on the value of
@defproc[(module-path-index-split [mpi module-path-index?]) @defproc[(module-path-index-split [mpi module-path-index?])
(values (or/c module-path? path? #f) (values (or/c module-path? #f)
(or/c module-path-index? resolved-module-path? #f))]{ (or/c module-path-index? resolved-module-path? #f))]{
Returns two values: a module path, and a base @tech{module path index} Returns two values: a module path, and a base @tech{module path index}
@ -235,7 +236,7 @@ A @racket[#f] for the first result implies a @racket[#f] for the
second result, and means that @racket[mpi] represents ``self'' (see second result, and means that @racket[mpi] represents ``self'' (see
above).} above).}
@defproc[(module-path-index-join [path (or/c module-path? path? #f)] @defproc[(module-path-index-join [path (or/c module-path? #f)]
[mpi (or/c module-path-index? resolved-module-path? #f)]) [mpi (or/c module-path-index? resolved-module-path? #f)])
module-path-index?]{ module-path-index?]{
@ -415,7 +416,7 @@ more than the namespace's @tech{base phase}.}
@defproc[(module-declared? @defproc[(module-declared?
[mod (or/c module-path? path? module-path-index? [mod (or/c module-path? module-path-index?
resolved-module-path?)] resolved-module-path?)]
[load? any/c #f]) [load? any/c #f])
boolean?]{ boolean?]{
@ -434,7 +435,7 @@ because the root module does not exist.}
@defproc[(module->language-info @defproc[(module->language-info
[mod (or/c module-path? path? module-path-index? [mod (or/c module-path? module-path-index?
resolved-module-path?)] resolved-module-path?)]
[load? any/c #f]) [load? any/c #f])
(or/c #f (vector/c module-path? symbol? any/c))]{ (or/c #f (vector/c module-path? symbol? any/c))]{
@ -452,7 +453,7 @@ implementation as compiled code.}
@defproc[(module->imports @defproc[(module->imports
[mod (or/c module-path? path? module-path-index? [mod (or/c module-path? module-path-index?
resolved-module-path?)]) resolved-module-path?)])
(listof (cons/c (or/c exact-integer? #f) (listof (cons/c (or/c exact-integer? #f)
(listof module-path-index?)))]{ (listof module-path-index?)))]{
@ -463,7 +464,7 @@ Like @racket[module-compiled-imports], but produces the imports of
@defproc[(module->exports @defproc[(module->exports
[mod (or/c module-path? path? resolved-module-path?)]) [mod (or/c module-path? resolved-module-path?)])
(values (listof (cons/c (or/c exact-integer? #f) list?)) (values (listof (cons/c (or/c exact-integer? #f) list?))
(listof (cons/c (or/c exact-integer? #f) list?)))]{ (listof (cons/c (or/c exact-integer? #f) list?)))]{
@ -472,7 +473,7 @@ Like @racket[module-compiled-exports], but produces the exports of
@tech{instantiate}d or @tech{visit}ed) in the current namespace.} @tech{instantiate}d or @tech{visit}ed) in the current namespace.}
@defproc[(module-predefined? @defproc[(module-predefined?
[mod (or/c module-path? path? resolved-module-path?)]) [mod (or/c module-path? resolved-module-path?)])
boolean?]{ boolean?]{
Reports whether @racket[mod] refers to a module that is predefined for Reports whether @racket[mod] refers to a module that is predefined for

View File

@ -4,21 +4,21 @@
"private/modcollapse-noctc.rkt") "private/modcollapse-noctc.rkt")
(define simple-rel-to-module-path-v/c (define simple-rel-to-module-path-v/c
(or/c (and/c module-path? (and/c module-path?
(or/c (or/c
(cons/c 'lib any/c) path?
(cons/c 'file any/c) (cons/c 'lib any/c)
(cons/c 'planet any/c) (cons/c 'file any/c)
(cons/c 'quote any/c) (cons/c 'planet any/c)
(cons/c 'submod (cons/c 'quote any/c)
(cons/c (or/c (cons/c 'submod
(cons/c 'lib any/c) (cons/c (or/c
(cons/c 'file any/c) path?
(cons/c 'planet any/c) (cons/c 'lib any/c)
(cons/c 'quote any/c)) (cons/c 'file any/c)
(listof symbol?))))) (cons/c 'planet any/c)
path? (cons/c 'quote any/c))
(cons/c 'submod (cons/c path? (listof symbol?))))) (listof symbol?))))))
(define rel-to-module-path-v/c (define rel-to-module-path-v/c
(or/c simple-rel-to-module-path-v/c (or/c simple-rel-to-module-path-v/c
@ -27,9 +27,7 @@
(-> simple-rel-to-module-path-v/c))) (-> simple-rel-to-module-path-v/c)))
(provide/contract (provide/contract
[collapse-module-path ((or/c module-path? [collapse-module-path (module-path?
path?
(cons/c 'submod (cons/c path? (listof (or/c symbol? "..")))))
rel-to-module-path-v/c rel-to-module-path-v/c
. -> . simple-rel-to-module-path-v/c)] . -> . simple-rel-to-module-path-v/c)]
[collapse-module-path-index ((or/c symbol? module-path-index?) [collapse-module-path-index ((or/c symbol? module-path-index?)

View File

@ -132,7 +132,7 @@
(or/c rel-to-path-string/c (-> rel-to-path-string/c) false/c)) (or/c rel-to-path-string/c (-> rel-to-path-string/c) false/c))
(provide/contract (provide/contract
[resolve-module-path ((or/c module-path-v? (cons/c 'submod (cons/c path? (listof (or/c ".." symbol?))))) [resolve-module-path (module-path?
rel-to-path-string/thunk/#f rel-to-path-string/thunk/#f
. -> . (or/c path? symbol? . -> . (or/c path? symbol?
(cons/c 'submod (cons/c (or/c path? symbol?) (cons/c 'submod (cons/c (or/c path? symbol?)

View File

@ -1,7 +1,6 @@
#lang racket/base #lang racket/base
(provide explode-relpath-string (provide explode-relpath-string
module-path-v?
module-path-v-string?) module-path-v-string?)
(define (explode-relpath-string p) (define (explode-relpath-string p)
@ -14,7 +13,3 @@
(and (regexp-match? #rx"^[-a-zA-Z0-9./]+$" v) (and (regexp-match? #rx"^[-a-zA-Z0-9./]+$" v)
(not (regexp-match? #rx"^/" v)) (not (regexp-match? #rx"^/" v))
(not (regexp-match? #rx"/$" v)))) (not (regexp-match? #rx"/$" v))))
(define (module-path-v? v)
(or (path? v)
(module-path? v)))

View File

@ -635,7 +635,7 @@
124,2,145,2,166,2,196,2,226,2,28,3,86,3,135,3,184,3,16,10,67, 124,2,145,2,166,2,196,2,226,2,28,3,86,3,135,3,184,3,16,10,67,
10,130,10,149,10,163,10,65,11,78,11,212,11,254,12,121,13,127,13,155,13, 10,130,10,149,10,163,10,65,11,78,11,212,11,254,12,121,13,127,13,155,13,
168,13,65,14,72,14,126,14,148,14,168,14,223,14,233,14,64,15,66,15,169, 168,13,65,14,72,14,126,14,148,14,168,14,223,14,233,14,64,15,66,15,169,
15,201,23,254,23,22,24,46,24,0,0,176,27,0,0,66,35,37,98,111,111, 15,175,23,228,23,252,23,20,24,0,0,150,27,0,0,66,35,37,98,111,111,
116,70,100,108,108,45,115,117,102,102,105,120,1,25,100,101,102,97,117,108,116, 116,70,100,108,108,45,115,117,102,102,105,120,1,25,100,101,102,97,117,108,116,
45,108,111,97,100,47,117,115,101,45,99,111,109,112,105,108,101,100,65,113,117, 45,108,111,97,100,47,117,115,101,45,99,111,109,112,105,108,101,100,65,113,117,
111,116,101,29,94,2,4,67,35,37,117,116,105,108,115,11,68,35,37,112,97, 111,116,101,29,94,2,4,67,35,37,117,116,105,108,115,11,68,35,37,112,97,
@ -878,103 +878,102 @@
2,192,86,94,23,193,1,90,159,38,11,89,161,38,36,11,249,80,159,48,52, 2,192,86,94,23,193,1,90,159,38,11,89,161,38,36,11,249,80,159,48,52,
39,23,201,2,11,250,22,1,22,177,14,23,199,1,249,22,87,249,22,2,32, 39,23,201,2,11,250,22,1,22,177,14,23,199,1,249,22,87,249,22,2,32,
0,88,163,8,36,37,44,11,9,222,33,69,23,200,1,248,22,83,248,2,70, 0,88,163,8,36,37,44,11,9,222,33,69,23,200,1,248,22,83,248,2,70,
23,201,1,28,248,22,159,14,23,196,2,86,94,23,196,1,28,248,22,182,14, 23,201,1,28,248,22,159,14,23,196,2,86,94,23,196,1,248,80,159,43,8,
23,196,2,248,80,159,43,8,27,39,248,22,186,14,23,197,2,248,22,83,6, 27,39,248,22,186,14,249,22,184,14,23,199,2,248,80,159,47,8,26,39,23,
26,26,32,40,97,32,112,97,116,104,32,109,117,115,116,32,98,101,32,97,98, 206,2,28,249,22,142,9,248,22,74,23,198,2,2,36,27,248,80,159,44,46,
115,111,108,117,116,101,41,28,249,22,142,9,248,22,74,23,198,2,2,36,27, 39,249,22,73,23,199,2,247,22,137,15,28,23,193,2,192,86,94,23,193,1,
248,80,159,44,46,39,249,22,73,23,199,2,247,22,137,15,28,23,193,2,192, 90,159,39,11,89,161,38,36,11,249,80,159,48,52,39,248,22,98,23,202,2,
86,94,23,193,1,90,159,39,11,89,161,38,36,11,249,80,159,48,52,39,248, 11,89,161,37,38,11,28,248,22,81,248,22,100,23,201,2,28,248,22,81,23,
22,98,23,202,2,11,89,161,37,38,11,28,248,22,81,248,22,100,23,201,2, 194,2,249,22,151,15,2,72,23,196,2,11,10,27,28,23,196,2,248,2,70,
28,248,22,81,23,194,2,249,22,151,15,2,72,23,196,2,11,10,27,28,23, 23,196,2,28,248,22,81,23,195,2,2,37,28,249,22,151,15,2,72,23,197,
196,2,248,2,70,23,196,2,28,248,22,81,23,195,2,2,37,28,249,22,151, 2,248,2,70,23,196,2,249,22,155,7,23,197,2,2,38,27,28,23,197,1,
15,2,72,23,197,2,248,2,70,23,196,2,249,22,155,7,23,197,2,2,38, 86,94,23,196,1,249,22,87,28,248,22,81,248,22,100,23,205,2,21,93,6,
27,28,23,197,1,86,94,23,196,1,249,22,87,28,248,22,81,248,22,100,23, 5,5,109,122,108,105,98,249,22,1,22,87,249,22,2,80,159,54,8,28,39,
205,2,21,93,6,5,5,109,122,108,105,98,249,22,1,22,87,249,22,2,80, 248,22,100,23,208,2,23,197,1,28,248,22,81,23,196,2,86,94,23,195,1,
159,54,8,28,39,248,22,100,23,208,2,23,197,1,28,248,22,81,23,196,2, 248,22,83,23,197,1,86,94,23,196,1,23,195,1,251,80,159,52,57,39,23,
86,94,23,195,1,248,22,83,23,197,1,86,94,23,196,1,23,195,1,251,80, 206,1,248,22,74,23,198,2,248,22,75,23,198,1,23,198,1,28,249,22,142,
159,52,57,39,23,206,1,248,22,74,23,198,2,248,22,75,23,198,1,23,198, 9,248,22,74,23,198,2,2,34,248,80,159,43,8,27,39,248,22,186,14,249,
1,28,249,22,142,9,248,22,74,23,198,2,2,34,248,80,159,43,8,27,39, 22,184,14,248,22,188,14,248,22,98,23,201,2,248,80,159,47,8,26,39,23,
248,22,186,14,249,22,184,14,248,22,188,14,248,22,98,23,201,2,248,80,159, 206,2,12,86,94,28,28,248,22,159,14,23,194,2,10,248,22,157,8,23,194,
47,8,26,39,23,206,2,12,86,94,28,28,248,22,159,14,23,194,2,10,248, 2,86,94,23,202,1,12,28,23,202,2,250,22,177,9,67,114,101,113,117,105,
22,157,8,23,194,2,86,94,23,202,1,12,28,23,202,2,250,22,177,9,67, 114,101,249,22,180,7,6,17,17,98,97,100,32,109,111,100,117,108,101,32,112,
114,101,113,117,105,114,101,249,22,180,7,6,17,17,98,97,100,32,109,111,100, 97,116,104,126,97,28,23,198,2,248,22,74,23,199,2,2,39,23,205,1,86,
117,108,101,32,112,97,116,104,126,97,28,23,198,2,248,22,74,23,199,2,2, 94,23,202,1,250,22,178,9,2,21,249,22,180,7,6,13,13,109,111,100,117,
39,23,205,1,86,94,23,202,1,250,22,178,9,2,21,249,22,180,7,6,13, 108,101,32,112,97,116,104,126,97,28,23,198,2,248,22,74,23,199,2,2,39,
13,109,111,100,117,108,101,32,112,97,116,104,126,97,28,23,198,2,248,22,74, 23,198,2,27,28,248,22,157,8,23,195,2,249,22,162,8,23,196,2,36,249,
23,199,2,2,39,23,198,2,27,28,248,22,157,8,23,195,2,249,22,162,8, 22,186,14,248,22,187,14,23,197,2,11,27,28,248,22,157,8,23,196,2,249,
23,196,2,36,249,22,186,14,248,22,187,14,23,197,2,11,27,28,248,22,157, 22,162,8,23,197,2,37,248,80,159,45,58,39,23,195,2,90,159,39,11,89,
8,23,196,2,249,22,162,8,23,197,2,37,248,80,159,45,58,39,23,195,2, 161,39,36,11,28,248,22,157,8,23,199,2,250,22,7,2,40,249,22,162,8,
90,159,39,11,89,161,39,36,11,28,248,22,157,8,23,199,2,250,22,7,2, 23,203,2,38,2,40,248,22,180,14,23,198,2,86,95,23,195,1,23,193,1,
40,249,22,162,8,23,203,2,38,2,40,248,22,180,14,23,198,2,86,95,23, 27,28,248,22,157,8,23,200,2,249,22,162,8,23,201,2,39,249,80,159,50,
195,1,23,193,1,27,28,248,22,157,8,23,200,2,249,22,162,8,23,201,2, 56,39,23,197,2,5,0,27,28,248,22,157,8,23,201,2,249,22,162,8,23,
39,249,80,159,50,56,39,23,197,2,5,0,27,28,248,22,157,8,23,201,2, 202,2,40,248,22,139,5,23,200,2,27,250,22,153,2,80,159,53,43,38,248,
249,22,162,8,23,202,2,40,248,22,139,5,23,200,2,27,250,22,153,2,80, 22,172,15,247,22,137,13,11,27,28,23,194,2,23,194,1,86,94,23,194,1,
159,53,43,38,248,22,172,15,247,22,137,13,11,27,28,23,194,2,23,194,1, 27,247,22,133,2,86,94,250,22,151,2,80,159,55,43,38,248,22,172,15,247,
86,94,23,194,1,27,247,22,133,2,86,94,250,22,151,2,80,159,55,43,38, 22,137,13,195,192,27,28,23,204,2,248,22,139,5,249,22,73,248,22,140,5,
248,22,172,15,247,22,137,13,195,192,27,28,23,204,2,248,22,139,5,249,22, 23,200,2,23,207,2,23,196,2,86,95,28,23,213,1,27,250,22,153,2,23,
73,248,22,140,5,23,200,2,23,207,2,23,196,2,86,95,28,23,213,1,27, 198,2,196,11,28,23,193,1,12,86,94,27,27,28,248,22,17,80,159,56,49,
250,22,153,2,23,198,2,196,11,28,23,193,1,12,86,94,27,27,28,248,22, 38,80,159,55,49,38,247,22,19,251,22,27,11,80,159,59,48,38,9,23,197,
17,80,159,56,49,38,80,159,55,49,38,247,22,19,251,22,27,11,80,159,59, 1,27,248,22,172,15,247,22,137,13,86,94,249,22,3,20,20,94,88,163,8,
48,38,9,23,197,1,27,248,22,172,15,247,22,137,13,86,94,249,22,3,20, 36,37,55,11,9,226,14,13,2,3,33,73,23,195,1,23,196,2,248,28,248,
20,94,88,163,8,36,37,55,11,9,226,14,13,2,3,33,73,23,195,1,23, 22,17,80,159,57,49,38,32,0,88,163,36,37,42,11,9,222,33,74,80,159,
196,2,248,28,248,22,17,80,159,57,49,38,32,0,88,163,36,37,42,11,9, 56,8,29,39,20,20,95,88,163,36,36,55,8,176,64,9,230,20,15,13,12,
222,33,74,80,159,56,8,29,39,20,20,95,88,163,36,36,55,8,176,64,9, 8,7,5,2,33,75,23,195,1,23,208,1,250,22,151,2,23,198,1,196,10,
230,20,15,13,12,8,7,5,2,33,75,23,195,1,23,208,1,250,22,151,2, 12,28,28,248,22,157,8,23,204,1,11,28,248,22,132,7,23,206,2,10,28,
23,198,1,196,10,12,28,28,248,22,157,8,23,204,1,11,28,248,22,132,7, 248,22,58,23,206,2,10,28,248,22,71,23,206,2,249,22,142,9,248,22,74,
23,206,2,10,28,248,22,58,23,206,2,10,28,248,22,71,23,206,2,249,22, 23,208,2,2,36,11,249,80,159,54,47,39,28,248,22,132,7,23,208,2,249,
142,9,248,22,74,23,208,2,2,36,11,249,80,159,54,47,39,28,248,22,132, 22,73,23,209,1,248,80,159,57,8,26,39,23,216,1,86,94,23,213,1,249,
7,23,208,2,249,22,73,23,209,1,248,80,159,57,8,26,39,23,216,1,86, 22,73,23,209,1,247,22,137,15,252,22,159,8,23,209,1,23,208,1,23,206,
94,23,213,1,249,22,73,23,209,1,247,22,137,15,252,22,159,8,23,209,1, 1,23,204,1,23,203,1,12,192,86,96,20,18,159,11,80,158,36,53,248,80,
23,208,1,23,206,1,23,204,1,23,203,1,12,192,86,96,20,18,159,11,80, 159,37,8,25,37,249,22,27,11,80,159,39,55,37,248,22,180,4,80,159,37,
158,36,53,248,80,159,37,8,25,37,249,22,27,11,80,159,39,55,37,248,22, 54,38,248,22,163,5,80,159,37,37,39,248,22,128,14,80,159,37,42,39,20,
180,4,80,159,37,54,38,248,22,163,5,80,159,37,37,39,248,22,128,14,80, 18,159,11,80,158,36,53,248,80,159,37,8,25,37,249,22,27,11,80,159,39,
159,37,42,39,20,18,159,11,80,158,36,53,248,80,159,37,8,25,37,249,22, 55,37,20,18,159,11,80,158,36,53,248,80,159,37,8,25,37,249,22,27,11,
27,11,80,159,39,55,37,20,18,159,11,80,158,36,53,248,80,159,37,8,25, 80,159,39,55,37,159,36,20,113,159,36,16,1,11,16,0,20,26,144,9,2,
37,249,22,27,11,80,159,39,55,37,159,36,20,113,159,36,16,1,11,16,0, 1,2,1,29,11,11,9,9,11,11,11,10,38,80,158,36,36,20,113,159,40,
20,26,144,9,2,1,2,1,29,11,11,9,9,11,11,11,10,38,80,158,36, 16,26,2,2,2,3,30,2,5,72,112,97,116,104,45,115,116,114,105,110,103,
36,20,113,159,40,16,26,2,2,2,3,30,2,5,72,112,97,116,104,45,115, 63,11,30,2,5,75,112,97,116,104,45,97,100,100,45,115,117,102,102,105,120,
116,114,105,110,103,63,11,30,2,5,75,112,97,116,104,45,97,100,100,45,115, 8,30,2,7,2,8,6,30,2,7,1,23,101,120,116,101,110,100,45,112,97,
117,102,102,105,120,8,30,2,7,2,8,6,30,2,7,1,23,101,120,116,101, 114,97,109,101,116,101,114,105,122,97,116,105,111,110,3,2,9,2,10,2,11,
110,100,45,112,97,114,97,109,101,116,101,114,105,122,97,116,105,111,110,3,2, 2,12,2,13,2,14,2,15,2,16,2,17,2,18,2,19,2,20,2,21,30,
9,2,10,2,11,2,12,2,13,2,14,2,15,2,16,2,17,2,18,2,19, 2,22,2,8,6,30,2,5,79,112,97,116,104,45,114,101,112,108,97,99,101,
2,20,2,21,30,2,22,2,8,6,30,2,5,79,112,97,116,104,45,114,101, 45,115,117,102,102,105,120,10,30,2,5,73,102,105,110,100,45,99,111,108,45,
112,108,97,99,101,45,115,117,102,102,105,120,10,30,2,5,73,102,105,110,100, 102,105,108,101,3,30,2,5,76,110,111,114,109,97,108,45,99,97,115,101,45,
45,99,111,108,45,102,105,108,101,3,30,2,5,76,110,111,114,109,97,108,45, 112,97,116,104,7,2,23,2,24,30,2,22,74,114,101,112,97,114,97,109,101,
99,97,115,101,45,112,97,116,104,7,2,23,2,24,30,2,22,74,114,101,112, 116,101,114,105,122,101,7,16,0,37,39,36,16,0,36,16,14,2,15,2,16,
97,114,97,109,101,116,101,114,105,122,101,7,16,0,37,39,36,16,0,36,16, 2,10,2,12,2,17,2,18,2,11,2,3,2,9,2,2,2,13,2,14,2,
14,2,15,2,16,2,10,2,12,2,17,2,18,2,11,2,3,2,9,2,2, 19,2,21,50,11,11,11,16,3,2,23,2,20,2,24,16,3,11,11,11,16,
2,13,2,14,2,19,2,21,50,11,11,11,16,3,2,23,2,20,2,24,16, 3,2,23,2,20,2,24,39,39,37,12,11,11,16,0,16,0,16,0,36,36,
3,11,11,11,16,3,2,23,2,20,2,24,39,39,37,12,11,11,16,0,16, 11,12,11,11,16,0,16,0,16,0,36,36,16,21,20,15,16,2,88,163,36,
0,16,0,36,36,11,12,11,11,16,0,16,0,16,0,36,36,16,21,20,15, 37,45,8,128,128,9,223,0,33,41,80,159,36,8,29,39,20,15,16,2,88,
16,2,88,163,36,37,45,8,128,128,9,223,0,33,41,80,159,36,8,29,39, 163,8,36,37,45,8,240,0,0,1,0,9,223,0,33,42,80,159,36,8,28,
20,15,16,2,88,163,8,36,37,45,8,240,0,0,1,0,9,223,0,33,42, 39,20,15,16,2,88,163,36,37,49,8,240,0,0,16,0,72,112,97,116,104,
80,159,36,8,28,39,20,15,16,2,88,163,36,37,49,8,240,0,0,16,0, 45,115,115,45,62,114,107,116,223,0,33,43,80,159,36,8,27,39,20,15,16,
72,112,97,116,104,45,115,115,45,62,114,107,116,223,0,33,43,80,159,36,8, 2,88,163,36,37,49,8,240,0,192,0,0,67,103,101,116,45,100,105,114,223,
27,39,20,15,16,2,88,163,36,37,49,8,240,0,192,0,0,67,103,101,116, 0,33,44,80,159,36,8,26,39,20,15,16,2,248,22,154,8,69,115,111,45,
45,100,105,114,223,0,33,44,80,159,36,8,26,39,20,15,16,2,248,22,154, 115,117,102,102,105,120,80,159,36,36,37,20,15,16,2,88,163,36,38,8,38,
8,69,115,111,45,115,117,102,102,105,120,80,159,36,36,37,20,15,16,2,88, 8,61,2,3,223,0,33,53,80,159,36,37,37,20,15,16,2,20,27,158,32,
163,36,38,8,38,8,61,2,3,223,0,33,53,80,159,36,37,37,20,15,16, 0,88,163,8,36,37,42,11,2,9,222,192,32,0,88,163,8,36,37,42,11,
2,20,27,158,32,0,88,163,8,36,37,42,11,2,9,222,192,32,0,88,163, 2,9,222,192,80,159,36,42,37,20,15,16,2,247,22,136,2,80,159,36,43,
8,36,37,42,11,2,9,222,192,80,159,36,42,37,20,15,16,2,247,22,136, 37,20,15,16,2,8,128,8,80,159,36,44,37,20,15,16,2,249,22,158,8,
2,80,159,36,43,37,20,15,16,2,8,128,8,80,159,36,44,37,20,15,16, 8,128,8,11,80,159,36,45,37,20,15,16,2,88,163,8,36,37,50,8,128,
2,249,22,158,8,8,128,8,11,80,159,36,45,37,20,15,16,2,88,163,8, 8,2,13,223,0,33,54,80,159,36,46,37,20,15,16,2,88,163,8,36,38,
36,37,50,8,128,8,2,13,223,0,33,54,80,159,36,46,37,20,15,16,2, 55,8,128,8,2,14,223,0,33,55,80,159,36,47,37,20,15,16,2,247,22,
88,163,8,36,38,55,8,128,8,2,14,223,0,33,55,80,159,36,47,37,20, 69,80,159,36,48,37,20,15,16,2,248,22,18,74,109,111,100,117,108,101,45,
15,16,2,247,22,69,80,159,36,48,37,20,15,16,2,248,22,18,74,109,111, 108,111,97,100,105,110,103,80,159,36,49,37,20,15,16,2,11,80,158,36,50,
100,117,108,101,45,108,111,97,100,105,110,103,80,159,36,49,37,20,15,16,2, 20,15,16,2,11,80,158,36,51,20,15,16,2,32,0,88,163,36,38,8,25,
11,80,158,36,50,20,15,16,2,11,80,158,36,51,20,15,16,2,32,0,88, 11,2,19,222,33,61,80,159,36,52,37,20,15,16,2,11,80,158,36,53,20,
163,36,38,8,25,11,2,19,222,33,61,80,159,36,52,37,20,15,16,2,11, 15,16,2,27,11,20,19,158,36,90,159,37,10,89,161,37,36,10,20,25,96,
80,158,36,53,20,15,16,2,27,11,20,19,158,36,90,159,37,10,89,161,37, 2,21,88,163,8,36,37,51,8,128,2,9,224,2,1,33,62,88,163,36,39,
36,10,20,25,96,2,21,88,163,8,36,37,51,8,128,2,9,224,2,1,33, 49,11,9,223,0,33,63,88,163,36,40,8,33,16,2,8,176,242,8,187,241,
62,88,163,36,39,49,11,9,223,0,33,63,88,163,36,40,8,33,16,2,8, 9,225,2,1,0,33,76,207,80,159,36,54,37,20,15,16,2,88,163,36,36,
176,242,8,187,241,9,225,2,1,0,33,76,207,80,159,36,54,37,20,15,16, 45,8,240,66,0,14,2,2,23,223,0,33,77,80,159,36,59,37,20,15,16,
2,88,163,36,36,45,8,240,66,0,14,2,2,23,223,0,33,77,80,159,36, 2,20,27,158,88,163,8,36,36,45,8,240,0,0,10,2,2,24,223,0,33,
59,37,20,15,16,2,20,27,158,88,163,8,36,36,45,8,240,0,0,10,2, 78,88,163,8,36,36,45,8,240,0,0,10,2,2,24,223,0,33,79,80,159,
2,24,223,0,33,78,88,163,8,36,36,45,8,240,0,0,10,2,2,24,223, 36,8,24,37,96,29,94,2,4,68,35,37,107,101,114,110,101,108,11,29,94,
0,33,79,80,159,36,8,24,37,96,29,94,2,4,68,35,37,107,101,114,110, 2,4,69,35,37,109,105,110,45,115,116,120,11,2,5,2,22,9,9,9,36,
101,108,11,29,94,2,4,69,35,37,109,105,110,45,115,116,120,11,2,5,2, 0};
22,9,9,9,36,0}; EVAL_ONE_SIZED_STR((char *)expr, 7266);
EVAL_ONE_SIZED_STR((char *)expr, 7292);
} }
{ {
SHARED_OK static MZCOMPILED_STRING_FAR unsigned char expr[] = {35,126,9,53,46,50,46,57,48,48,46,49,84,0,0,0,0,0,0,0,0, SHARED_OK static MZCOMPILED_STRING_FAR unsigned char expr[] = {35,126,9,53,46,50,46,57,48,48,46,49,84,0,0,0,0,0,0,0,0,

View File

@ -2333,6 +2333,9 @@ int scheme_is_module_path(Scheme_Object *obj)
} }
} }
if (SCHEME_PATHP(obj))
return 1;
if (SCHEME_CHAR_STRINGP(obj)) { if (SCHEME_CHAR_STRINGP(obj)) {
return ok_path_string(obj, 1, 1, 1, 0); return ok_path_string(obj, 1, 1, 1, 0);
} }
@ -2835,9 +2838,8 @@ static Scheme_Object *module_to_namespace(int argc, Scheme_Object *argv[])
env = scheme_get_env(NULL); env = scheme_get_env(NULL);
if (!SCHEME_PATHP(argv[0]) if (!scheme_is_module_path(argv[0]))
&& !scheme_is_module_path(argv[0])) scheme_wrong_type("module->namespace", "module path", 0, argc, argv);
scheme_wrong_type("module->namespace", "path or module-path", 0, argc, argv);
return scheme_module_to_namespace(argv[0], env); return scheme_module_to_namespace(argv[0], env);
} }
@ -2856,7 +2858,7 @@ static Scheme_Module *module_to_(const char *who, int argc, Scheme_Object *argv[
&& !SCHEME_MODNAMEP(name) && !SCHEME_MODNAMEP(name)
&& !SAME_TYPE(SCHEME_TYPE(name), scheme_module_index_type) && !SAME_TYPE(SCHEME_TYPE(name), scheme_module_index_type)
&& !scheme_is_module_path(name)) && !scheme_is_module_path(name))
scheme_wrong_type(who, "path, module-path, module-path index, or resolved-module-path", 0, argc, argv); scheme_wrong_type(who, "module path, module-path index, or resolved-module-path", 0, argc, argv);
if (!SCHEME_MODNAMEP(name)) { if (!SCHEME_MODNAMEP(name)) {
if (!SAME_TYPE(SCHEME_TYPE(name), scheme_module_index_type)) if (!SAME_TYPE(SCHEME_TYPE(name), scheme_module_index_type))
@ -3276,10 +3278,9 @@ static Scheme_Object *module_path_index_split(int argc, Scheme_Object *argv[])
static Scheme_Object *module_path_index_join(int argc, Scheme_Object *argv[]) static Scheme_Object *module_path_index_join(int argc, Scheme_Object *argv[])
{ {
if (!SCHEME_PATHP(argv[0]) if (!scheme_is_module_path(argv[0])
&& !scheme_is_module_path(argv[0])
&& !SCHEME_FALSEP(argv[0])) && !SCHEME_FALSEP(argv[0]))
scheme_wrong_type("module-path-index-join", "module path, path, or #f", 0, argc, argv); scheme_wrong_type("module-path-index-join", "module path or #f", 0, argc, argv);
if (argv[1]) { /* mzc will generate NULL sometimes; see scheme_declare_module(), below */ if (argv[1]) { /* mzc will generate NULL sometimes; see scheme_declare_module(), below */
if (SCHEME_TRUEP(argv[1]) if (SCHEME_TRUEP(argv[1])

View File

@ -959,9 +959,7 @@
" cols)" " cols)"
"(list(ss->rkt file))))))))" "(list(ss->rkt file))))))))"
"((path? s) " "((path? s) "
"(if(absolute-path? s)" "(path-ss->rkt(simplify-path(path->complete-path s(get-dir)))))"
"(path-ss->rkt(simplify-path s))"
" (list \" (a path must be absolute)\")))"
"((eq?(car s) 'lib)" "((eq?(car s) 'lib)"
"(or(path-cache-get(cons s(current-library-collection-paths)))" "(or(path-cache-get(cons s(current-library-collection-paths)))"
"(let*-values(((cols file)(split-relative-string(cadr s) #f))" "(let*-values(((cols file)(split-relative-string(cadr s) #f))"

View File

@ -1090,10 +1090,8 @@
cols) cols)
(list (ss->rkt file)))))))] (list (ss->rkt file)))))))]
[(path? s) [(path? s)
(if (absolute-path? s) ;; Use filesystem-sensitive `simplify-path' here:
;; Use filesystem-sensitive `simplify-path' here: (path-ss->rkt (simplify-path (path->complete-path s (get-dir))))]
(path-ss->rkt (simplify-path s))
(list " (a path must be absolute)"))]
[(eq? (car s) 'lib) [(eq? (car s) 'lib)
(or (path-cache-get (cons s (current-library-collection-paths))) (or (path-cache-get (cons s (current-library-collection-paths)))
(let*-values ([(cols file) (split-relative-string (cadr s) #f)] (let*-values ([(cols file) (split-relative-string (cadr s) #f)]