'from' statement documented

This commit is contained in:
Araq 2013-05-19 23:41:12 +02:00
commit a23d418d78
4 changed files with 33 additions and 4 deletions

View file

@ -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
~~~~~~~~~~~~~~~~