168 |
providing module's public interface, the entire export list is available |
providing module's public interface, the entire export list is available |
169 |
without renaming (@pxref{Using Guile Modules}). |
without renaming (@pxref{Using Guile Modules}). |
170 |
|
|
171 |
To use a module, it must be found and loaded. All Guile modules have |
To use a module, it must be found and loaded. All Guile modules have a |
172 |
a unique @dfn{module name}, which is a list of one or more symbols. |
unique @dfn{module name}, which is a list of one or more symbols. |
173 |
Examples are @code{(ice-9 popen)} or @code{(srfi srfi-11)}. When |
Examples are @code{(ice-9 popen)} or @code{(srfi srfi-11)}. When Guile |
174 |
Guile searches for the code of a module, it constructs the name of the |
searches for the code of a module, it constructs the name of the file to |
175 |
file to load by concatenating the name elements with slashes between |
load by concatenating the name elements with slashes between the |
176 |
the elements and appending a number of file name extensions from the |
elements and appending a number of file name extensions from the list |
177 |
list @code{%load-extensions} (@pxref{Loading}). The resulting file |
@code{%load-extensions} (@pxref{Loading}). The resulting file name is |
178 |
name is then searched in all directories in the variable |
then searched in all directories in the variable @code{%load-path} |
179 |
@code{%load-path} (@pxref{Install Config}). For example, the |
(@pxref{Build Config}). For example, the @code{(ice-9 popen)} module |
180 |
@code{(ice-9 popen)} module would result in the filename |
would result in the filename @code{ice-9/popen.scm} and searched in the |
181 |
@code{ice-9/popen.scm} and searched in the installation directories of |
installation directories of Guile and in all other directories in the |
182 |
Guile and in all other directories in the load path. |
load path. |
183 |
|
|
184 |
@c FIXME::martin: Not sure about this, maybe someone knows better? |
@c FIXME::martin: Not sure about this, maybe someone knows better? |
185 |
Every module has a so-called syntax transformer associated with it. |
Every module has a so-called syntax transformer associated with it. |
200 |
To use a Guile module is to access either its public interface or a |
To use a Guile module is to access either its public interface or a |
201 |
custom interface (@pxref{General Information about Modules}). Both |
custom interface (@pxref{General Information about Modules}). Both |
202 |
types of access are handled by the syntactic form @code{use-modules}, |
types of access are handled by the syntactic form @code{use-modules}, |
203 |
which accepts one or more interface specifications and, upon |
which accepts one or more interface specifications and, upon evaluation, |
204 |
evaluation, arranges for those interfaces to be available to the |
arranges for those interfaces to be available to the current module. |
205 |
current module. This process may include locating and loading code |
This process may include locating and loading code for a given module if |
206 |
for a given module if that code has not yet been loaded, following |
that code has not yet been loaded, following %load-path (@pxref{Build |
207 |
%load-path (@pxref{Install Config}). |
Config}). |
208 |
|
|
209 |
An @dfn{interface specification} has one of two forms. The first |
An @dfn{interface specification} has one of two forms. The first |
210 |
variation is simply to name the module, in which case its public |
variation is simply to name the module, in which case its public |