Version: 4.2.1.8
8 Modules
8.1 Require and Provide
(require (planet cce/scheme:5:0/require-provide)) |
This module provides tools for managing the imports and exports of modules.
(require/provide module-path ...) |
Re-exports all bindings provided by each module-path. Equivalent to:
(require module-path ...) |
(provide (all-from-out module-path ...)) |
(quote-require require-spec ...) |
Produces the names exported by the require-specs as a list of symbols.
Example: |
> (quote-require scheme/bool scheme/function) |
(true false symbol=? false? boolean=? negate curryr curry const) |
(local-require require-spec ...) |
This form performs a require into a local definition context. It achieves this
by lifting a #%require form to the top level and introducing the
bindings locally with rename transformers. For many purposes this is the same
as a regular require; however, only bindings for the current phase are
made available, and all names are introduced as syntax bindings even if the
exported identifiers included value bindings.
(do-local-require rename require-spec ...) |
This form generalizes do-local-require to use an arbitrary macro
rename (of the same syntactic form as define-renamings) to
introduce local bindings.
This module also provides define-planet-package and this-package-in from (planet cce/scheme:5:0/planet).
8.2 PLaneT Packages
(require (planet cce/scheme:5:0/planet)) |
This module provides tools relating to PLaneT packages.
Produces a symbol corresponding to a planet module path for the current
planet package, possibly with a ‹path› (from the grammar of
planet module specs) into the package. This is similar to
this-package-version and similar tools from
planet/util.
(define-planet-package name package) |
Defines a shortcut name for importing modules from planet package
package. Subsequently, (name module) is equivalent to
(planet package/module) as a require path. For instance, to import the
text and web modules from this package:
(define-planet-package my-package cce/scheme) |
(require (my-package web) (my-package text)) |
The above require is equivalent to:
(require (planet cce/scheme/web) (planet cce/scheme/text))
(this-package-in path) |
This
require transformer
imports the file at path in the current planet package. For instance,
in this package (cce/scheme:5:0), writing:
... is equivalent to writing:
(defmodule/this-package) |
(defmodule/this-package #:use-sources [src-path ...] [src ...]) |
(defmodule/this-package path) |
(defmodule/this-package path #:use-sources [src-path ...] [src ...]) |
This Scribble form corresponds to defmodule within a planet package.
The displayed module path is a planet module path to the current planet
package, possibly with a ‹path› (from the grammar of planet
module specs) into the package. If the #:use-sources option is
present, each src-path is similarly treated as a path into the current
planet package, while each src is treated normally. Both sets of paths
are concatenated and passed to the normal defmodule.
(defmodule*/no-declare/this-package [src-path ...] [src ...]) |
This Scribble form corresponds to defmodule*/no-declare within a planet
package. The displayed module paths are planet module paths to the
current planet package, possibly with ‹path›s (from the grammar of
planet module specs) into the package. Each src-path is
similarly treated as a path into the current planet package, while each
src is treated normally. Both sets of paths are concatenated and
passed to the normal defmodule*/no-declare.
This Scribble form corresponds to schememodname much like
defmodule/this-package above corresponds to defmodule. The
path, if present, is treated as a ‹path› (from the grammar of
planet module specs) into the current planet package, and converted
into a planet module spec.
(declare-exporting/this-package [mod-path ...] [mod ...]) | ||
|
This Scribble form corresponds to declare-exporting much like
defmodule/this-package above corresponds to defmodule. Each
mod-path and src-path is treated as a ‹path› (from the
grammar of planet module specs) into the current package. They are
concatenated with the lists of mods and srcs, respectively,
and passed to the normal declare-exporting.
8.3 Scribble Documentation
This module currently provides this-package-version-symbol, defmodule/this-package, defmodule*/no-declare/this-package, schememodname/this-package, and declare-exporting/this-package from (planet cce/scheme:5:0/planet).
8.4 Sandboxed Evaluation
(require (planet cce/scheme:5:0/sandbox)) |
This module provides tools for sandboxed evaluation.
| |||||||||||||||||||||||||||||||
|
These procedures wrap calls to make-evaluator and
make-module-evaluator, respectively, with
call-with-trusted-sandbox-configuration (introduced in PLT 4.1.3.6).
In older versions of PLT Scheme, they simulate the trusted configuration as
closely as possible.
| |||||||||||||||||||||||||||||||
|
These procedures wrap calls to make-trusted-evaluator and
make-trusted-module-evaluator, respectively, with parameterizations
setting sandbox-output and sandbox-error-output to
'string.
| ||||||||
→ (cons/c (-> namespace?) (listof module-path?)) | ||||||||
make-ns : (-> namespace?) | ||||||||
path : module-path? |
This function produces a value for the parameter
sandbox-namespace-specs such that new sandbox evaluators start with a
namespace constructed by make-ns and share a set of instances of the
modules referred to by the given paths.