Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Correct.

You can break the connection between a variable and the "strand" of an indexing expression by wrapping part of the prefix in parentheses, forcing it to be evaluated first, separately from the following parts of the strand. Consider these cases:

a:11,22,33
b:a
# these are 'simple' assignments;
# 'a' and 'b' both refer to (11,99,33)

a[1]:99
# evaluates to (11,99,33),
# 'a' now contains (11,99,33)
# 'b' still contains (11,22,33)

(b)[1]:88
# evaluates to (11,88,33),
# but the contents of 'b' is unchanged.
# equivalent to (11,22,33)[1]:88

And this wouldn't be syntactically valid at all, since it has neither a direct variable name at the "head" of the strand nor any indices at which to amend:

(b[1]):77

But we can do weird-looking things like this, amending the empty list at an index to create a singleton dictionary:

().foo:"bar"
# evaluates to {"foo":"bar"}
# equivalent to ()["foo"]:"bar"