Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Unfortunate that the Julia folks weren't exposed to this when they designed the language.


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.


For 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: