diff options
author | Grzegorz Adam Hankiewicz <gradha@imap.cc> | 2013-12-30 13:29:28 +0100 |
---|---|---|
committer | Grzegorz Adam Hankiewicz <gradha@imap.cc> | 2014-01-15 22:23:17 +0100 |
commit | 0029832ba1797cf6c78defd9ece3d972929864b6 (patch) | |
tree | 9cc59bea791ca2cc53dfbee10c49c1ec4e3a307a /doc | |
parent | 9602349f308dd860f94b720f8f03476edf9cccaf (diff) | |
download | Nim-0029832ba1797cf6c78defd9ece3d972929864b6.tar.gz |
Adds note about iterators having same signature as procs.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/tut1.txt | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/doc/tut1.txt b/doc/tut1.txt index 817bc6905..91bff41d7 100644 --- a/doc/tut1.txt +++ b/doc/tut1.txt @@ -813,7 +813,11 @@ important differences: However, you can also use a ``closure`` iterator to get a different set of restrictions. See `first class iterators <manual.html#first-class-iterators>`_ -for details. +for details. Iterators can have the same name and parameters as a proc, +essentially they have their own namespace. Therefore it is common practice to +wrap iterators in procs of the same name which accumulate the result of the +iterator and return it as a sequence, like ``split`` from the `strutils module +<strutils.html>`_. Basic types |