www.delorie.com/gnu/docs/guile/guile_357.html   search  
 
Buy GNU books!


Guile Reference Manual

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

31.3.3 Creating Guile Modules

When you want to create your own modules, you have to take the following steps:

syntax: define-module module-name [options ...]
module-name is of the form (hierarchy file). One example of this is

 
(define-module (ice-9 popen))

define-module makes this module available to Guile programs under the given module-name.

The options are keyword/value pairs which specify more about the defined module. The recognized options and their meaning is shown in the following table.

#:use-module interface-specification
Equivalent to a (use-modules interface-specification) (see section 31.3.2 Using Guile Modules).

#:use-syntax module
Use module when loading the currently defined module, and install it as the syntax transformer.

#:autoload module symbol
Load module whenever symbol is accessed.

#:export list
Export all identifiers in list, which must be a list of symbols. This is equivalent to (export list) in the module body.

#:no-backtrace
Tell Guile not to record information for procedure backtraces when executing the procedures in this module.

#:pure
Create a pure module, that is a module which does not contain any of the standard procedure bindings except for the syntax forms. This is useful if you want to create safe modules, that is modules which do not know anything about dangerous procedures.

syntax: export variable ...
Add all variables (which must be symbols) to the list of exported bindings of the current module.

syntax: define-public ...
Equivalent to (begin (define foo ...) (export foo)).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003