10.1.1 Language Objectives
A module in #lang ricoeur/tei/spec-lang consists of interleaved runtime and documentation-time code, some of which is generated from syntactic forms that have meanings at both phases. (This is somewhat analagous to scribble/lp2, which was used in an earlier version of this library.) Additionally, to promote modularity and avoid cyclic dependency problems, some portions of a module in #lang ricoeur/tei/spec-lang are encapsulated to be invoked later, generally after being linked with encapsulated information from other #lang ricoeur/tei/spec-lang modules. (This is somewhat analagous to the racket/unit system, which was used in an earlier version of this library.) The next several sections of this manual will explain these aspects of the #lang ricoeur/tei/spec-lang language in detail.
The documentation-time phase of the module is grouped into an implicit doc submodule (declared with module*), which may be incorporated into a larger Scribble document via include-section.
Each module in #lang ricoeur/tei/spec-lang exports an elements specification transformer binding that encapsulates the specifications of the TEI XML elements defined in that module. This can be invoked using define-values/elements-specifications, possibly after being linked with other modules’ elements specification transformers, to generate definitions for tei-xexpr/c, xexpr->tei-element, and other derived bindings. More details of elements specification transformers will be discussed below, especially under define-element.
Optionally, a module in #lang ricoeur/tei/spec-lang can export bindings using provide like any other module. In particular, a module may provide functions that operate on the tei element struct types it defines. Some of these may become part of the public API of this ricoeur/tei/base, while others may be used only in the implementation of cooperating #lang ricoeur/tei/spec-lang modules. All of Racket’s facilities are available for managing and protecting such exports.