I've almost finished converting the default Table implementations to running on the shared heap, using my "shared seq". But I'm running into trouble because my type doesn't handle indexes like the seq does. Unless I'm mistaken, it seems that seq can accept _negative_ array indexes too.
Here is the code lines that cause an error when using replacing seq with my "shared seq". template maxHash(t): untyped = high(t.data) # ... var h: Hash = hc and maxHash(t) while isFilled(t.data[h].hcode): # t.data is a seq in the original code. # ... And my "shared seq" gets called with an index of -3359640189252970303, which it (obviously) doesn't like. Idk where the implementation of "proc []" for seq is, so I cannot look it up. The closest I have found (in system.nim) is this: # :array|openarray|string|seq|cstring|tuple proc `[]`*[I: Ordinal;T](a: T; i: I): T {. noSideEffect, magic: "ArrGet".} But idk where/how "ArrGet" is defined.