Scheme 48 Manual -- SRFIs

Scheme 48 Manual | Contents | In Chapter: Libraries
Previous: SRFIs | Next: SRFIs

## SRFIs

`SRFI' stands for `Scheme Request For Implementation'. An SRFI is a description of an extension to standard Scheme. Draft and final SRFI documents, a FAQ, and other information about SRFIs can be found at the SRFI web site.

Scheme 48 includes implementations of the following (final) SRFIs:

- SRFI 1 - List Library
- SRFI 2 - `and-let*`
- SRFI 5 - `let` with signatures and rest arguments
- SRFI 6 - Basic string ports
- SRFI 7 - Program configuration
- SRFI 8 - `receive`
- SRFI 9 - Defining record types
- SRFI 11 - Syntax for receiving multiple values
- SRFI 13 - String Library
- SRFI 14 - Character-Set Library (see note below)
- SRFI 16 - Syntax for procedures of variable arity
- SRFI 17 - Generalized `set!`
- SRFI 23 - Error reporting mechanism

Documentation on these can be found at the web site mentioned above.

SRFI 14 includes the procedure `->char-set` which is not a standard Scheme identifier (in R5RS the only required identifier starting with `-` is `-` itself). In the Scheme 48 version of SRFI 14 we have renamed `->char-set` as `x->char-set`.

The SRFI bindings can be accessed either by opening the appropriate structure (the structure `srfi-``n` contains SRFI `n`) or by loading structure `srfi-7` and then using the `,load-srfi-7-program` command to load an SRFI 7-style program. The syntax for the command is

>     ,load-srfi-7-program name filename

This creates a new structure and associated package, binds the structure to `name` in the configuration package, and then loads the program found in `filename` into the package.

As an example, if the file `test.scm` contains

>     (program (code (define x 10)))

this program can be loaded as follows:

>     > ,load-package srfi-7
>     > ,load-srfi-7-program test test.scm
>     [test]
>     > ,in test
>     test> x
>     10
>     test>

Previous: SRFIs | Next: SRFIs