for x in arr (something ())
\ /-- function call
and for x in arr (something ())
\ /-- loop body
This is consequence of combining "blocks" and "precedence" into the same construct (). for x in arr do set z += x;
for x in arr do something x;
IIRC these both currently require an explicit block in my parser. x = [1, [2]];
var y = x;
set y.[0] = 3; // clones the outer array, keeps a reference to inner array
set y.[1].[0] = 4; // clones the inner array here. Outer array is now exclusive so it doesn't need another clone.
var z = x;
set z.[1].[0] = 4; // clones both arrays at once x = 1; // declares x as immutable
var y = 2; // declares y as mutable
The "default" behaviour (if no keyword is used) is to define a new immutable variable.
This only works because prompt caching is done by matching prefixes, not the entire input.