aboutsummaryrefslogtreecommitdiff
path: root/manual/manual.of
diff options
context:
space:
mode:
Diffstat (limited to 'manual/manual.of')
-rw-r--r--manual/manual.of12
1 files changed, 10 insertions, 2 deletions
diff --git a/manual/manual.of b/manual/manual.of
index ea9a0302..9e0b8835 100644
--- a/manual/manual.of
+++ b/manual/manual.of
@@ -1346,8 +1346,10 @@ then all values returned by that call enter the list of values,
1346before the adjustment 1346before the adjustment
1347(except when the call is enclosed in parentheses; see @See{expressions}). 1347(except when the call is enclosed in parentheses; see @See{expressions}).
1348 1348
1349The assignment statement first evaluates all its expressions 1349If a variable is both assigned and read
1350and only then the assignments are performed. 1350inside a multiple assignment,
1351Lua ensures all reads get the value of the variable
1352before the assignment.
1351Thus the code 1353Thus the code
1352@verbatim{ 1354@verbatim{
1353i = 3 1355i = 3
@@ -1367,6 +1369,12 @@ x, y, z = y, z, x
1367} 1369}
1368cyclically permutes the values of @id{x}, @id{y}, and @id{z}. 1370cyclically permutes the values of @id{x}, @id{y}, and @id{z}.
1369 1371
1372Note that this guarantee covers only accesses
1373syntactically inside the assignment statement.
1374If a function or a metamethod called during the assignment
1375changes the value of a variable,
1376Lua gives no guarantees about the order of that access.
1377
1370An assignment to a global name @T{x = val} 1378An assignment to a global name @T{x = val}
1371is equivalent to the assignment 1379is equivalent to the assignment
1372@T{_ENV.x = val} @see{globalenv}. 1380@T{_ENV.x = val} @see{globalenv}.