8.16.0.1
reprovide-lang
1 #lang reprovide
#lang reprovide | package: reprovide-lang-lib |
A #lang language for reproviding modules.
For example, a module that reprovided racket/match and
racket/list at runtime, and provided racket/base
and syntax/parse for-syntax would look like this:
#lang reprovide racket/match racket/list (for-syntax racket/base syntax/parse)
syntax
(#%module-begin require-spec ...)
2 reprovide as a macro
(require reprovide/reprovide) | package: reprovide-lang-lib |
This module provides reprovide as a macro.
syntax
(reprovide require-spec ...)
3 Extra require forms
3.1 Require with fallbacks
(require reprovide/require-transformer/combine-in-fallback) | |
package: reprovide-lang-lib |
These forms are provided by both #lang reprovide and reprovide/require-transformer/combine-in-fallback.
syntax
(combine-in/fallback require-spec ...)
The union of the require-specs, where imports not in the
first ones can "fall back" on imports in subsequent ones.
Like (combine-in require-spec ...), but more lenient when imports from the require-specs have the same identifier name: the first ones take precedence over the subsequent ones.
syntax
(allow-in require-spec id-maybe-renamed ...)
id-maybe-renamed = id | [orig-id bind-id]
Like (only-in require-spec id-maybe-renamed ...), but more
lenient when id or orig isn’t in the
require-spec.
These can be used together to import an identifier if it exists, but
fall back on a different identifier otherwise:
(require (combine-in/fallback |
(allow-in racket/unsafe/ops |
[unsafe-f32vector-set! unsafe?-f32vector-set!]) |
(allow-in ffi/vector |
[f32vector-set! unsafe?-f32vector-set!]))) |
3.2 Require by glob
(require reprovide/require-transformer/glob-in) | |
package: reprovide-lang-lib |
These forms are provided by both #lang reprovide and reprovide/require-transformer/glob-in.
syntax
(glob-in glob-str ...)
Examples:
requires every file ending in .rkt or .scrbl in the given directory.
requires six things, according to every combination of options:
linear/data.rkt
linear/transformation.rkt
linear/decomposition.rkt
affine/data.rkt
affine/transformation.rkt
affine/decomposition.rkt
The syntax for each glob-str is described in Globbing.