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]
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: