summary refs log tree commit diff stats
path: root/doc/tut1.txt
diff options
context:
space:
mode:
authorGrzegorz Adam Hankiewicz <gradha@imap.cc>2013-12-30 13:11:06 +0100
committerGrzegorz Adam Hankiewicz <gradha@imap.cc>2014-01-15 22:23:17 +0100
commit9602349f308dd860f94b720f8f03476edf9cccaf (patch)
treec81000ac9b2cc806ed7ad368c34dad7704f1e748 /doc/tut1.txt
parent338a93f1197fe135e31b13865ab0ef6aa9ee9864 (diff)
downloadNim-9602349f308dd860f94b720f8f03476edf9cccaf.tar.gz
Adds note about procs and multiple variable assignment.
Diffstat (limited to 'doc/tut1.txt')
-rw-r--r--doc/tut1.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/doc/tut1.txt b/doc/tut1.txt
index 2070c69d6..817bc6905 100644
--- a/doc/tut1.txt
+++ b/doc/tut1.txt
@@ -202,6 +202,12 @@ statement and all the variables will have the same value:
   echo "x ", x  # outputs "x 42"
   echo "y ", y  # outputs "y 3"
 
+Note that declaring multiple variables with a single assignment which calls a
+procedure can have unexpected results: the compiler will *unroll* the
+assignments and end up calling the procedure several times. If the result of
+the procedure depends on side effects, your variables may end up having
+different values! For safety use only constant values.
+
 
 Constants
 =========