1 Running Top-Level Programs
2 Installing Libraries
3 Libraries and Collections
4 Scheme Interoperability
5 R6RS Conformance
6 R6RS Libraries
Index
Version: 4.0.2

 

3 Libraries and Collections

An R6RS library name is sequence of symbols, optionally followed by a version as a sequence of exact, non-negative integers. Roughly, such a name is converted to a PLT Scheme module pathname (see Module Paths) by concatenating the symbols with a / separator, and then appending the version integers each with a preceeding -. As a special case, when an R6RS path contains a single symbol followed by a version, a main symbol is effectively inserted after the initial symbol.

When an R6RS library or top-level program refers to another library, it can supply version constraints rather than naming a specific version. Version constraints are always resolved at compile time by searching the set of installed files.

In addition, when an R6RS library path is converted, a file extension is selected at compile time based on installed files. The search order for file extensions is ".mzscheme.ss", ".mzscheme.sls", ".ss", and ".sls". When resolving version constraints, these extensions are all tried when looking for matches.

Examples (assuming a typical PLT Scheme installation):

  (rnrs io simple (6))  means  (lib "rnrs/io/simple-6.ss")

  (rnrs)                means  (lib "rnrs/main-6.ss")

  (rnrs (6))            means  (lib "rnrs/main-6.ss")

  (scheme base)         means  (lib "scheme/base.ss")