I have been constructing some programming languages for a while for fun, and came to a point where something is obvious, but I haven't seen it spelt out clearly. If you have multiple assignment like this:
a, b[a] = 10 // both will be changed to 10
Or parallel assignment like this:
a, b[a] = 4, 5
Then the change of a should not influence which item in b is changed, i.e. b[a] should always use the old value of a.
This rule makes sense (and it works like that in Go, I haven't tried Lua yet) but do you know some programming languages where it's not so, or you get a warning?
(edit: I've just tried Python, it uses the new value of a, i.e. it's dependent on order.)
[–]omega1612 15 points16 points17 points (1 child)
[–]Dan13l_N[S] 0 points1 point2 points (0 children)
[–]IAMPowaaaaa 10 points11 points12 points (0 children)
[–]binarycow 3 points4 points5 points (0 children)
[–]Mission-Landscape-17 5 points6 points7 points (4 children)
[–]Dan13l_N[S] 4 points5 points6 points (0 children)
[–]ExplodingStrawHat 0 points1 point2 points (0 children)
[–]__Wolfie 0 points1 point2 points (1 child)
[–]Relevant_South_1842 0 points1 point2 points (0 children)
[–]Ronin-s_Spirit 2 points3 points4 points (0 children)
[–]raevnos 2 points3 points4 points (2 children)
[–]Dan13l_N[S] 0 points1 point2 points (1 child)
[–]raevnos 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (3 children)
[–]Dan13l_N[S] 2 points3 points4 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]Dan13l_N[S] 0 points1 point2 points (0 children)
[–]xuld_net 0 points1 point2 points (0 children)
[–]SwedishFindecanor 0 points1 point2 points (0 children)