Next: scheme overview programs, Previous: scheme overview continuations, Up: scheme overview [Index]
Scheme code can be organized in components called libraries. Each library contains definitions and expressions. It can import definitions from other libraries and export definitions to other libraries.
The following library called ‘(hello)’ exports a definition called
hello-world
, and imports the base library and the simple I/O
library. The hello-world
export is a procedure that displays
‘Hello World’ on a separate line:
(library (hello) (export hello-world) (import (rnrs base) (rnrs io simple)) (define (hello-world) (display "Hello World") (newline)))