Previous: Intro to Modules and Extensions, Up: Guile Modules


5.5.4 Preloaded Modules for Interactive Sessions

For convenience, several modules pre-loaded for interactive sessions (see Running Guile Interactively). Primarily, the module (ice-9 session) provides procedures to extend %load-path, access documentation, search for symbol names, etc., useful for exploration. Other modules are not documented at this time.

Because these modules are preloaded, you do not need to do anything special to use them during an interactive session. For scripts (see Guile Scripts), however, you can load them explicitly with the expression:

     (use-modules (ice-9 session))

The rest of this section describes the procedures and macros available by loading module (ice-9 sesssion).

— Scheme Procedure: add-to-load-path! directory [append?]

Add directory to %load-path, if it is not already there. Add at the beginning, unless optional arg append? is non-#f.

— Scheme Procedure: set-fancy-repl-prompt! format-string

Set the repl prompt based on format-string. Each character in format-string stands for itself, with the exception of the following tilde escapes:

~M
Stands for the “current module”.

— Scheme Macro: help [args...]

Display various forms of help depending on args, or a detailed description of help usage if given no args.

— Scheme Procedure: apropos rgx [options...]

Search for bindings matching rgx, a regular expression string. options are symbols: full, shadow, value.

— Scheme Procedure: apropos-internal rgx

Return a list of accessible variable names for rgx.

— Scheme Procedure: apropos-fold proc init rgx folder

Fold PROCEDURE over bindings matching third arg REGEXP.

Result is

            (PROCEDURE MODULE1 NAME1 VALUE1
              (PROCEDURE MODULE2 NAME2 VALUE2
                ...
                (PROCEDURE MODULEn NAMEn VALUEn INIT)))

where INIT is the second arg to `apropos-fold'.

Fourth arg FOLDER is one of

            (apropos-fold-accessible MODULE) ;fold over bindings accessible in MODULE
            apropos-fold-exported		   ;fold over all exported bindings
            apropos-fold-all		   ;fold over all bindings
— Scheme Procedure: apropos-fold-accessible module

FIXME: Docs incomplete.

— Scheme Procedure: source obj

Return the source code for obj, a procedure or macro. The source code is an acyclic structured expression (tree of symbols, etc). If obj does not have source code associated with it, return #f.

— Scheme Procedure: arity proc

Display the arity of procedure proc.