Well, yes, accesing array element directly by integer index would be needed here too.
Not sure how fast it could be when compared to direct memory access and how much stuff needs to be exported to make it usable, when checking eg. source of E.crc32 it looks relatively easy. But when checking E.mapInPlace it can be seen there are quite a lot of methods for various types. Or in jswrap_graphics.c I see lot of usage of string iterator, also plenty of methods there.
But you mentioned JsvIterator and looks like there is generic implementation wrapping those various types here src/jsvariterator.c#L649 so maybe it could be easy after all?
© Espruino, powered by microcosm.
Report a problem