3 ms·
I don't get that 1 based indexing debate in regard to LUA and Julia. Both came up recently on hackernews. In LUA you can use the metatable functionality to imp
by freemint 6y ago
I don't get that 1 based indexing debate in regard to LUA and Julia. Both came up recently on hackernews.
In LUA you can use the metatable functionality to implement 0 based indexes.
In Julia you can overload the array access operation too. There a packages which allow zero based indexing. Or even StarWars based indexing including the machete viewing order. https://github.com/giordano/StarWarsArrays.jl https://github.com/giordano/StarWarsArrays.jl
Julia's array interface has has functionality what the first/last index is, so you can use it in other peoples code. If they haer coded 1 as first index just make a pull request to fix it.
- pansa2 6y ago> In LUA you can use the metatable functionality to implement 0 based indexes. I tried to do that a while back and kept coming across corner cases that didn’t work. Is there a complete implementation of zero-based arrays for Lua available anywhere?