diff options
author | Araq <rumpf_a@web.de> | 2013-05-19 23:41:12 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2013-05-19 23:41:12 +0200 |
commit | a23d418d78f7c35b2e7aed23ed6beb60e2542b83 (patch) | |
tree | 41f3a1e14b9b38bf4eb0ebae0cf90156c96b4302 /doc | |
parent | 5edf02a7ab7f46c5841104538a313fad5dbba5f9 (diff) | |
download | Nim-a23d418d78f7c35b2e7aed23ed6beb60e2542b83.tar.gz |
'from' statement documented
Diffstat (limited to 'doc')
-rw-r--r-- | doc/manual.txt | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/manual.txt b/doc/manual.txt index f7b2314c1..4d2cd6a62 100644 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -4178,6 +4178,25 @@ module name followed by an ``except`` to prevent some symbols to be imported: echo "$1" % "abc" +From import statement +~~~~~~~~~~~~~~~~~~~~~ + +After the `from`:idx: statement a module name follows followed by +an ``import`` to list the symbols one likes to use without explict +full qualification: + +.. code-block:: nimrod + from strutils import `%` + + echo "$1" % "abc" + # always possible: full qualification: + echo strutils.replace("abc", "a", "z") + +It's also possible to use ``from module import nil`` if one wants to import +the module but wants to enforce fully qualified access to every symbol +in ``module``. + + Export statement ~~~~~~~~~~~~~~~~ |