From a23d418d78f7c35b2e7aed23ed6beb60e2542b83 Mon Sep 17 00:00:00 2001 From: Araq Date: Sun, 19 May 2013 23:41:12 +0200 Subject: [PATCH] 'from' statement documented --- doc/manual.txt | 19 +++++++++++++++++++ todo.txt | 4 ++-- web/news.txt | 9 +++++++-- web/ticker.txt | 5 +++++ 4 files changed, 33 insertions(+), 4 deletions(-) diff --git a/doc/manual.txt b/doc/manual.txt index f7b2314c19..4d2cd6a622 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 ~~~~~~~~~~~~~~~~ diff --git a/todo.txt b/todo.txt index 6588433d25..5214245ae8 100644 --- a/todo.txt +++ b/todo.txt @@ -1,4 +1,4 @@ -version 0.9.2 +version 0.9.4 ============= - make 'bind' default for templates and introduce 'mixin'; @@ -27,7 +27,7 @@ Bugs - result = result shr 8 for the "system()" wrapper -version 0.9.4 +version 0.9.x ============= - macros as type pragmas diff --git a/web/news.txt b/web/news.txt index f66c066671..906fb1108c 100644 --- a/web/news.txt +++ b/web/news.txt @@ -11,7 +11,8 @@ the logo) as well as the HTML and CSS code for his template, and Dominik Picheta for integrating Philip's design with the ``nimweb`` utility. We're sure you will agree that Philip's design is beautiful. -2013-XX-XX Version 0.9.2 released + +2013-05-20 Version 0.9.2 released ================================= Version 0.9.2 has been released! Get it `here `_. @@ -96,6 +97,9 @@ Language Additions - Objects can be initialized via an *object constructor expression*. - There is a new syntactic construct ``(;)`` unifying expressions and statements. +- You can now use ``from module import nil`` if you want to import the module + but want to enforce fully qualified access to every symbol in ``module``. + Notes for the future -------------------- @@ -106,6 +110,7 @@ Notes for the future functions. All the high-level features of the current ``sockets`` module will be moved to a ``network`` module. + 2012-09-23 Version 0.9.0 released ================================= @@ -493,7 +498,7 @@ Changes affecting backwards compatibility - The pointer dereference operation ``p^`` is deprecated and might become ``^p`` in later versions or be dropped entirely since it is rarely used. Use the new notation ``p[]`` in the rare cases where you need to - dereference a pointer explicitely. + dereference a pointer explicitly. - ``system.readFile`` does not return ``nil`` anymore but raises an ``EIO`` exception instead. - Unsound co-/contravariance for procvars has been removed. diff --git a/web/ticker.txt b/web/ticker.txt index e0965238f5..b47c5642a2 100644 --- a/web/ticker.txt +++ b/web/ticker.txt @@ -1,3 +1,8 @@ + +

May 20, 2013

+

Nimrod version 0.9.2 has been released!

+
+

Sep 23, 2012

Nimrod version 0.9.0 has been released!