summary refs log tree commit diff stats
path: root/doc
diff options
context:
space:
mode:
authorAndrea Ferretti <ferrettiandrea@gmail.com>2018-10-11 15:59:14 +0200
committerAndreas Rumpf <rumpf_a@web.de>2018-10-11 15:59:14 +0200
commit160f8599c6836f5ade1ba35321141d8de94581f7 (patch)
treed62b25b83dd73068da1c22fba3ec7df2c8fbe0a9 /doc
parent26a9ba71c8ecc42fc93f5ac2278efcf095073926 (diff)
downloadNim-160f8599c6836f5ade1ba35321141d8de94581f7.tar.gz
Clarify that term rewriting macros are applied recursively (#9305)
Fixes https://github.com/nim-lang/Nim/issues/9288 fixes https://github.com/nim-lang/Nim/issues/8376 and fixes https://github.com/nim-lang/Nim/issues/2901
Diffstat (limited to 'doc')
-rw-r--r--doc/manual.rst6
1 files changed, 6 insertions, 0 deletions
diff --git a/doc/manual.rst b/doc/manual.rst
index 588da07e2..d64da0e3f 100644
--- a/doc/manual.rst
+++ b/doc/manual.rst
@@ -5965,6 +5965,12 @@ curlies is the pattern to match against. The operators ``*``,  ``**``,
 notation, so to match verbatim against ``*`` the ordinary function call syntax
 needs to be used.
 
+Term rewriting macro are applied recursively, up to a limit. This means that
+if the result of a term rewriting macro is eligible for another rewriting,
+the compiler will try to perform it, and so on, until no more optimizations
+are applicable. To avoid putting the compiler into an infinite loop, there is
+a hard limit on how many times a single term rewriting macro can be applied.
+Once this limit has been passed, the term rewriting macro will be ignored.
 
 Unfortunately optimizations are hard to get right and even the tiny example
 is **wrong**: