summary refs log tree commit diff stats
path: root/doc/manual/templates.txt
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-11-15 11:10:13 +0100
committerAraq <rumpf_a@web.de>2014-11-15 11:10:13 +0100
commitf7dca91344392a200392bdbd5d2d7c5167298e93 (patch)
treeff064678872c4a6ce43ee41b292d12feeb223ece /doc/manual/templates.txt
parent9e00d3aec2da69c23cdb5dba0e3f654e99ded379 (diff)
downloadNim-f7dca91344392a200392bdbd5d2d7c5167298e93.tar.gz
fixes #619
Diffstat (limited to 'doc/manual/templates.txt')
-rw-r--r--doc/manual/templates.txt19
1 files changed, 17 insertions, 2 deletions
diff --git a/doc/manual/templates.txt b/doc/manual/templates.txt
index 4793d68a7..d90c2203e 100644
--- a/doc/manual/templates.txt
+++ b/doc/manual/templates.txt
@@ -225,8 +225,8 @@ a template. ``inject`` and ``gensym`` have no effect in ``dirty`` templates.
 
 
 
-Limitations of the method invokation syntax
--------------------------------------------
+Limitations of the method call syntax
+-------------------------------------
 
 The expression ``x`` in ``x.f`` needs to be semantically checked (that means
 symbol lookup and type checking) before it can be decided that it needs to be
@@ -241,6 +241,21 @@ is used to invoke templates/macros:
   unknownIdentifier.declareVar
 
 
+Another common example is this:
+
+.. code-block:: nim
+  from sequtils import toSeq
+
+  iterator something: string =
+    yield "Hello"
+    yield "World"
+
+  var info = something().toSeq()
+
+The problem here is that the compiler already decided that ``something()`` as
+an iterator is not callable in this context before ``toSeq`` gets its
+chance to convert it into a sequence.
+
 
 Macros
 ======