diff options
author | mboratko <boratko@gmail.com> | 2018-06-18 02:05:35 -0400 |
---|---|---|
committer | Varriount <Varriount@users.noreply.github.com> | 2018-06-18 02:05:35 -0400 |
commit | 70664bd1a25cac6ce1a3d49ff82796153abbbc4f (patch) | |
tree | 9e926a98d2c9d4e706a7979543110f6ef1860561 /doc/tut1.rst | |
parent | 4616b28c7b592c8204d9f77f3c1f7db2fb7186d8 (diff) | |
download | Nim-70664bd1a25cac6ce1a3d49ff82796153abbbc4f.tar.gz |
Changed tutorial documentation referring to 'constant' to 'immutable' (#8056)
* Changed tutorial documentation referring to 'constant' to 'immutable' * Clarification regarding side-effect free procedures fo:r multiple assignments
Diffstat (limited to 'doc/tut1.rst')
-rw-r--r-- | doc/tut1.rst | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/doc/tut1.rst b/doc/tut1.rst index f2251c463..aa6114cf7 100644 --- a/doc/tut1.rst +++ b/doc/tut1.rst @@ -208,7 +208,8 @@ 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. +different values! For safety use side-effect free procedures if making multiple +assignments. Constants @@ -642,7 +643,7 @@ initialisation. Parameters ---------- -Parameters are constant in the procedure body. By default, their value cannot be +Parameters are immutable in the procedure body. By default, their value cannot be changed because this allows the compiler to implement parameter passing in the most efficient way. If a mutable variable is needed inside the procedure, it has to be declared with ``var`` in the procedure body. Shadowing the parameter name |