addressing memory by integer index (position) reshuffles signals within that memory

v0.4.39

mov mem1[1] 5[item=pistol]

shuffles all existing signals in mem1 to new positions within mem1. all the previous indices are now totally invalid. all other memories have the same symptom.

this happens not just on writing a signal to memory, but also on reading one!

mov r1 mem1[1]

that's a bit of a surprise.

i get that this is a direct result of the way Lua/Factorio stores the signals - as a dictionary a.k.a. associative array rather than a uniform array or vector. it works fine as long as i always address signals by type rather than by position:

emit mem1 5[item=pistol]

or

fid r1 mem1 [item=pistol]

this doesn't bother me much - i've learned to avoid it: never address a memory by position. only registers can be addressed that way.

i'm creating this issue mainly to just track progress on implementing whatever solution is practical for this, OR changing the docs to indicate this is not possible now nor in the future. i'm very glad to see work has picked up again on this underappreciated mod.