4 R6RS Module Language

▼ |  | R6RS: Scheme

1 | Using R6RS with Dr Racket
2 | Running Top-Level Programs
3 | Installing Libraries
4 | R6RS Module Language
5 | Libraries and Collections
6 | Language Interoperability
7 | R6RS Conformance
8 | R6RS Libraries
| Index

On this page:

#%module-begin

top← prev up next →

### 4`` R6RS Module Language

#lang r6rs

The r6rs language is usually used in the form #! r6rs, which is equivalent to #lang r6rs and is also valid R6RS syntax.

The r6rs module language provides only a #%module-begin binding, which is used to process the entire module body (see module). It allows the body of a module to use the syntax of either a R6RS library or a R6RS top-level program.

(#%module-begin
(library library-name
(export export-spec ...)
(import import-spec ...)
library-body ...))

(#%module-begin
(import import-spec ...)
program-body ...)

An r6rs module that contains a single library form defines an R6RS library, while a module body that starts with an import form defined an R6RS top-level program.

The library, export, and import identifiers are not exported by the r6rs library; they are recognized through equivalence to unbound identifiers.

top← prev up next →