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-14 01:38:17 +0100
committerAraq <rumpf_a@web.de>2014-11-14 01:38:17 +0100
commitad71fb41a3367ef2661b0aacb86f792e0b7192b5 (patch)
tree666695f8d507c8657f4521e1fdbd54ccb30a6585 /doc/manual/templates.txt
parent37cc9b2226fc422561700dd1197450106db2b7c5 (diff)
downloadNim-ad71fb41a3367ef2661b0aacb86f792e0b7192b5.tar.gz
fixes #1258
Diffstat (limited to 'doc/manual/templates.txt')
-rw-r--r--doc/manual/templates.txt17
1 files changed, 17 insertions, 0 deletions
diff --git a/doc/manual/templates.txt b/doc/manual/templates.txt
index d63f61f54..4793d68a7 100644
--- a/doc/manual/templates.txt
+++ b/doc/manual/templates.txt
@@ -225,6 +225,23 @@ a template. ``inject`` and ``gensym`` have no effect in ``dirty`` templates.
 
 
 
+Limitations of the method invokation 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
+rewritten to ``f(x)``. Therefore the dot syntax has some limiations when it
+is used to invoke templates/macros:
+
+.. code-block:: nim
+  template declareVar(name: expr): stmt =
+    const name {.inject.} = 45
+
+  # Doesn't compile:
+  unknownIdentifier.declareVar
+
+
+
 Macros
 ======