diff options
author | Araq <rumpf_a@web.de> | 2014-11-14 01:49:26 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-11-14 01:49:26 +0100 |
commit | a848c2d02b16bf55ff4e435ea40a465d42dda871 (patch) | |
tree | d77c2ea4efcf9897f5b6039f213fad60e2d8a52f | |
parent | 1e8c06c5d68a62337801b61c8cac88d9d7ceabde (diff) | |
download | Nim-a848c2d02b16bf55ff4e435ea40a465d42dda871.tar.gz |
fixes #1634
-rw-r--r-- | doc/manual/modules.txt | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/doc/manual/modules.txt b/doc/manual/modules.txt index f412587db..95a13a560 100644 --- a/doc/manual/modules.txt +++ b/doc/manual/modules.txt @@ -6,7 +6,8 @@ Modules enable `information hiding`:idx: and `separate compilation`:idx:. A module may gain access to symbols of another module by the `import`:idx: statement. `Recursive module dependencies`:idx: are allowed, but slightly subtle. Only top-level symbols that are marked with an asterisk (``*``) are -exported. +exported. A valid module name can only be a valid Nim identifier (and thus its +filename is ``identifier.nim``). The algorithm for compiling modules is: @@ -53,6 +54,17 @@ module name followed by an ``except`` to prevent some symbols to be imported: echo "$1" % "abc" +Include statement +~~~~~~~~~~~~~~~~~ +The ``include`` statement does something fundamentally different than +importing a module: it merely includes the contents of a file. The ``include`` +statement is useful to split up a large module into several files: + +.. code-block:: nim + include fileA, fileB, fileC + + + Module names in imports ~~~~~~~~~~~~~~~~~~~~~~~ |