Previous: Included Guile Modules, Up: The Guile module system
The last sections have described how modules are used in Scheme code, which is the recommended way of creating and accessing modules. You can also work with modules from C, but it is more cumbersome.
The following procedures are available.
Set the current module to module and return the previous current module.
Call func and make module the current module during the call. The argument data is passed to func. The return value of
scm_c_call_with_current_module
is the return value of func.
Return the variable bound to the symbol indicated by name in the current module. If there is no such binding or the symbol is not bound to a variable, signal an error.
Like
scm_c_lookup
andscm_lookup
, but the specified module is used instead of the current one.
Bind the symbol indicated by name to a variable in the current module and set that variable to val. When name is already bound to a variable, use that. Else create a new variable.
Like
scm_c_define
, but the symbol is specified directly.
Like
scm_c_define
andscm_define
, but the specified module is used instead of the current one.
Find the symbol that is bound to variable in module. When no such binding is found, return #f.
Define a new module named name and make it current while init is called, passing it data. Return the module.
The parameter name is a string with the symbols that make up the module name, separated by spaces. For example, `"foo bar"' names the module `(foo bar)'.
When there already exists a module named name, it is used unchanged, otherwise, an empty module is created.
Find the module name name and return it. When it has not already been defined, try to auto-load it. When it can't be found that way either, create an empty module. The name is interpreted as for
scm_c_define_module
.
Like
scm_c_resolve_module
, but the name is given as a real list of symbols.