Adds note about procs and multiple variable assignment.
This commit is contained in:
parent
338a93f119
commit
9602349f30
1 changed files with 6 additions and 0 deletions
|
|
@ -202,6 +202,12 @@ statement and all the variables will have the same value:
|
||||||
echo "x ", x # outputs "x 42"
|
echo "x ", x # outputs "x 42"
|
||||||
echo "y ", y # outputs "y 3"
|
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
|
Constants
|
||||||
=========
|
=========
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue