[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
6.19.5 R6RS Version References
Guile’s module system includes support for locating modules based on
a declared version specifier of the same form as the one described in
R6RS (see R6RS Library Form in The Revised^6 Report on the Algorithmic Language Scheme). By using the
#:version
keyword in a define-module
form, a module may
specify a version as a list of zero or more exact, nonnegative integers.
This version can then be used to locate the module during the module
search process. Client modules and callers of the use-modules
function may specify constraints on the versions of target modules by
providing a version reference, which has one of the following
forms:
(sub-version-reference ...) (and version-reference ...) (or version-reference ...) (not version-reference)
in which sub-version-reference is in turn one of:
(sub-version) (>= sub-version) (<= sub-version) (and sub-version-reference ...) (or sub-version-reference ...) (not sub-version-reference)
in which sub-version is an exact, nonnegative integer as above. A version reference matches a declared module version if each element of the version reference matches a corresponding element of the module version, according to the following rules:
-
The
and
sub-form matches a version or version element if every element in the tail of the sub-form matches the specified version or version element. -
The
or
sub-form matches a version or version element if any element in the tail of the sub-form matches the specified version or version element. -
The
not
sub-form matches a version or version element if the tail of the sub-form does not match the version or version element. -
The
>=
sub-form matches a version element if the element is greater than or equal to the sub-version in the tail of the sub-form. -
The
<=
sub-form matches a version element if the version is less than or equal to the sub-version in the tail of the sub-form. - A sub-version matches a version element if one is eqv? to the other.
For example, a module declared as:
(define-module (mylib mymodule) #:version (1 2 0))
would be successfully loaded by any of the following use-modules
expressions:
(use-modules ((mylib mymodule) #:version (1 2 (>= 0)))) (use-modules ((mylib mymodule) #:version (or (1 2 0) (1 2 1)))) (use-modules ((mylib mymodule) #:version ((and (>= 1) (not 2)) 2 0)))
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on April 20, 2013 using texi2html 5.0.