| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Note that imports are not transitive. The modules that module-names are importing are not automatically imported to the current module. This keeps modules' modularity; a library module can import whatever modules it needs without worring about polluting the namespace of the user of the module.
(use foo) is equivalent
to the following two forms:
(require "foo") (import foo) |
foo" (if not yet
loaded) which defines a module named foo in it,
and then import the module
foo into the current module.
Although the files and modules are orthogonal concept,
it is practically convenient to separate files by modules.
Gauche doesn't force you to do so, and you can always use
require and import separately. However, all
modules provided with Gauche are arranged so that they can be
used by use macro.
If a module is too big to fit in one file, you can split them into several subfiles and one main file. The main file defines the module, and either loads, requires, or autoloads subfiles.
If name contains periods `.', it is replaced to `/'
in the file name.to be required, for example,
(use foo.bar.baz) is expanded to:
(require "foo/bar/baz") (import foo.bar.baz) |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |