You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I honestly don't know what should happen when you temporarily assign to a map or array member, but all these results seem wrong, or at least surprising:
Exhibit 1:
⬥ var x = [&y=1]
⬥ { tmp x[y] = 2; put $x }
⮕ [&y=2]
⬥ put $x
⮕ [&y=$nil]
Exhibit 2:
⬥ var x = [&y=1]
⬥ { tmp x[z] = 2; put $x }
⮕ [&y=1 &z=2]
⬥ put $x
⮕ [&y=1 &z=$nil]
Exhibit 3:
⬥ var x = [1 2 3]
⬥ { tmp x[1] = 9; put $x }
⮕ [1 9 3]
⬥ put $x
⮕ [1 $nil 3]
The text was updated successfully, but these errors were encountered:
xiaq
changed the title
Temporary assignments to map or array members produce odd results
Temporary assignments to map or array members leave them always set to $nil
Jun 7, 2022
I honestly don't know what should happen when you temporarily assign to a map or array member, but all these results seem wrong, or at least surprising:
Exhibit 1:
Exhibit 2:
Exhibit 3:
The text was updated successfully, but these errors were encountered: