summary refs log tree commit diff stats
path: root/doc
diff options
context:
space:
mode:
authorawr <41453959+awr1@users.noreply.github.com>2018-09-04 15:25:46 -0500
committerawr <41453959+awr1@users.noreply.github.com>2018-09-04 15:25:46 -0500
commit47726ecb9e4af38bfdad7f94f03d27385f2ac0f6 (patch)
tree24b821b742067a20a9ed5629148ec9b31d48bd1b /doc
parent8062698e7f6c28debb7e938e472ac64632e6a1ff (diff)
downloadNim-47726ecb9e4af38bfdad7f94f03d27385f2ac0f6.tar.gz
updated manual for declared()
Diffstat (limited to 'doc')
-rw-r--r--doc/manual.rst14
1 files changed, 14 insertions, 0 deletions
diff --git a/doc/manual.rst b/doc/manual.rst
index 26ff071d7..e76cf3d78 100644
--- a/doc/manual.rst
+++ b/doc/manual.rst
@@ -6896,6 +6896,20 @@ level:
 
   a() # outputs: "5"
 
+The values of expressions involving `declared` are decided *before* the code
+reordering process, and not after. As an example, the output of this code is
+the same as it would be with code reordering disabled.
+
+.. code-block:: nim
+  {.reorder: on.}
+
+  proc x() =
+    echo(declared(foo))
+
+  var foo = 4
+
+  x() # "false"
+
 It is important to note that reordering *only* works for symbols at top level
 scope. Therefore, the following will *fail to compile:*