Node:About SRFI Usage, Next:, Up:SRFI Support



39.1 About SRFI Usage

SRFI support in Guile is currently implemented partly in the core library, and partly as add-on modules. That means that some SRFIs are automatically available when the interpreter is started, whereas the other SRFIs require you to use the appropriate support module explicitly.

There are several reasons for this inconsistency. First, the feature checking syntactic form cond-expand (see SRFI-0) must be available immediately, because it must be there when the user wants to check for the Scheme implementation, that is, before she can know that it is safe to use use-modules to load SRFI support modules. The second reason is that some features defined in SRFIs had been implemented in Guile before the developers started to add SRFI implementations as modules (for example SRFI-6 (see SRFI-6)). In the future, it is possible that SRFIs in the core library might be factored out into separate modules, requiring explicit module loading when they are needed. So you should be prepared to have to use use-modules someday in the future to access SRFI-6 bindings. If you want, you can do that already. We have included the module (srfi srfi-6) in the distribution, which currently does nothing, but ensures that you can write future-safe code.

Generally, support for a specific SRFI is made available by using modules named (srfi srfi-number), where number is the number of the SRFI needed. Another possibility is to use the command line option --use-srfi, which will load the necessary modules automatically (see Invoking Guile).