(rapid library-definition)

R7RS library definitions. Subsumed by (rapid analyze-library)

Library definition objects

Library definition objects internalize R7RS library definitions.

Qualified identifiers

A qualified identifier is a triple consisting of a library name, an identifier naming a top-level binding of that library (before renaming), and a syntax object to locate syntax error messages.

(unwrap-library-name library-name-syntax)

Returns the Scheme datum representing the R7RS library name wrapped in the syntax object library-name-syntax. If library-name-syntax does not wrap a proper R7RS library name as a Scheme datum, a syntax error object is signaled. If the exception is continued, unwrap-library-name returns #f.

Procedures

(make-qualified-identifier context library-name symbol)

Returns a qualified identifier in the library library-name with name symbol and syntax object context.

(qualified-identifier? object)

Returns #t if object is a qualified identifier, and #f otherwise.

(qualified-identifier-library-name qualified-identifier)

Returns the library name of the qualified-identifier.

(qualified-identifier-symbol qualified-identifier)

Returns the name of the qualified-identifier.

(qualified-identifier-context qualified-identifier)

Returns the syntax object of the qualified-identifier.

(make-library-definition library-name declarations)

Returns a library definition object for the library with name library-name and declarations declarations. The library name is a Scheme datum representing an R7RS library name, and the declarations are a list of syntax objects each wrapping a Scheme datum representing an R7RS library declaration.

(library-definition? object)

Returns #t if object is a library definition object, and #f otherwise.

(library-definition-exports library-definition)

Returns a mapping that maps all the identifiers exported by the library-definition to their original bindings, which are identified by qualified identifiers.

(library-definition-imports library-definition)

Returns a mapping that maps all the identifiers imported by the library-definition to their original bindings, which are identified by qualified identifiers.

(library-body library-definition)

Returns the library body of the library-definition, a sequence of syntax objects each wrapping a top-level command or definition.

(feature-identifier? symbol)

Returns #t if symbol is a feature identifier in the current dynamic environment, and #f otherwise.

(library-importable? context library-name)

Returns #t if, in the current dynamic environment, the library with name library-name can be imported, and #f otherwise. Context is either #f or a syntax object that can be referred to if library-exports raises a syntax error object.

(library-exports context library-name)

Returns a mapping that maps all the identifiers exported by the library with name library-name to their original bindings, which are identified by qualified identifiers, or #f if there is no such library known. Context is either #f or a syntax object that can be referred to if library-exports raises a syntax error object.

Parameter objects

(feature-identifier-predicate)

Returns the current predicate queried when invoking feature-identifier?. This procedure is a parameter object. The initial binding is not specified.

(library-importability-predicate)

Returns the current predicate queried when invoking library-importable?. This procedure is a parameter object. The initial binding is not specified.

(library-exports-accessor)

Returns the current accessor queried when invoking library-exports. This procedure is a parameter object. The initial binding is not specified.

Comparators

symbol-comparator

Comparator for symbols. Has an ordering predicate and a hash function.

library-name-comparator

Comparator for R7RS library names as Scheme datums. Has an ordering predicate and a hash function.

(library-name? object)

Type-test predicate for library names. Returns #t if object is a Scheme datum representing a library name, and #f otherwise.