Document extension to multi-in.
This commit is contained in:
parent
3210aa6014
commit
48b5725b2e
|
@ -1161,20 +1161,34 @@ but then sub-directories that are called
|
||||||
@filepath{utils} override the one in the project's root.
|
@filepath{utils} override the one in the project's root.
|
||||||
In other words, the previous method requires only a single unique name.}
|
In other words, the previous method requires only a single unique name.}
|
||||||
|
|
||||||
@defform[(multi-in parent child ...)
|
@defform[(multi-in (dir ...) ...)
|
||||||
#:contracts ([parent module-path?] [child module-path?])]{
|
#:contracts ([dir module-path?])]{
|
||||||
Specifies multiple files to be required from directory
|
Specifies multiple files to be required from a hierarchy of
|
||||||
@racket[parent] relative to the current directory, or from
|
directories or collects.
|
||||||
subcollects @racket[child] in collect @racket[parent].
|
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
@racketblock[(require (multi-in racket list dict))]
|
@racketblock[(require (multi-in racket (list dict)))]
|
||||||
is equivalent to:
|
is equivalent to:
|
||||||
@racketblock[(require racket/list racket/dict)]
|
@racketblock[(require racket/list racket/dict)]
|
||||||
Similarly:
|
Similarly:
|
||||||
@racketblock[(require (multi-in "utils" "math.rkt" "matrix.rkt"))]
|
@racketblock[(require (multi-in "utils" ("math.rkt" "matrix.rkt")))]
|
||||||
is equivalent to:
|
is equivalent to:
|
||||||
@racketblock[(require "utils/math.rkt" "utils/matrix.rkt")]
|
@racketblock[(require "utils/math.rkt" "utils/matrix.rkt")]
|
||||||
|
|
||||||
|
It is also possible to require to require files with identical names
|
||||||
|
located in different directories:
|
||||||
|
@racketblock[(require (multi-in ("math" "matrix") "utils.rkt"))]
|
||||||
|
which is equivalent to:
|
||||||
|
@racketblock[(require "math/utils.rkt" "matrix/utils.rkt")]
|
||||||
|
or even:
|
||||||
|
@racketblock[(require (multi-in ("math" "matrix") ("utils.rkt" "helpers.rkt")))]
|
||||||
|
which is equivalent to:
|
||||||
|
@racketblock[(require "math/utils.rkt" "math/helpers.rkt" "matrix/utils.rkt" "matrix/helpers.rkt")]
|
||||||
|
|
||||||
|
Deeper nesting is also possible:
|
||||||
|
@racketblock[(require (multi-in "math" "matrix" "utils.rkt"))]
|
||||||
|
is equivalent to:
|
||||||
|
@racketblock[(require "math/matrix/utils.rkt")]
|
||||||
}
|
}
|
||||||
|
|
||||||
@; --------------------
|
@; --------------------
|
||||||
|
|
Loading…
Reference in New Issue
Block a user