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

Same. I haven't made a mistake on this issue for a long time despite switching languages with conventions frequently.

The only thing I will say is terrible is I believe julia had something you could do to make it a 0 indexed language just for you? That seemed like a terrible idea, haha. I have never seen anyone use it thankfully



You can't make the language 0 based, that would indeed be a terrible idea. Instead, you can make array types which have whatever indexing behaviour you like.

Because of the focus on generic code, these custom array types are basically first class citizens. See for example https://github.com/JuliaArrays/OffsetArrays.jl

Almost every serious julia package is written in such a way that they can handle such arrays correctly.




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

Search: