fixes #1258
This commit is contained in:
parent
37cc9b2226
commit
ad71fb41a3
1 changed files with 17 additions and 0 deletions
|
|
@ -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
|
Macros
|
||||||
======
|
======
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue