3 ms·
Sometimes I port some other language code to Lua and in such cases the 1-based indexing can be tricky. Though recently I discovered using a metatable to convert
by wsc981 4y ago
Sometimes I port some other language code to Lua and in such cases the 1-based indexing can be tricky. Though recently I discovered using a metatable to convert the index from 1-based to 0-based and vice versa can make the porting a bit smoother wrt this issue.