2 ms·
Unfortunate that the Julia folks weren't exposed to this when they designed the language.
by ur-whale 4y ago
Unfortunate that the Julia folks weren't exposed to this when they designed the language.
- Jtsummers 4y agohttps://juliaarrays.github.io/OffsetArrays.jl/stable/ https://juliaarrays.github.io/OffsetArrays.jl/stable/ 0-based or any arbitrary offset of your choice so that your data model can more closely map to what you need it to. And use eachindex instead of making assumptions and you can work with arrays using 1-based, 0-based, or arbitrary-based indexing.
- ur-whale 4y agoFor this particular problem, having a choice even worse than 1-based indexing. Code become a giant PITA to read because you have to switch back and forth.