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

Yes, and it is a perfectly fine feature when applied correctly. It would be incorrect to assume that an `AbstractArray` starts at `1` or `0` which is why the updated example now correctly uses `eachindex`: https://docs.julialang.org/en/v1/devdocs/boundscheck/#Elidin...

If you want to assume that an array starts at `1` one needs to require an `Array` rather than an `AbstractArray`.



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

Search: