3 ms·
Why allow iterating with 1:length(A) if it's not the good way ?
by poulpy123 4y ago
Why allow iterating with 1:length(A) if it's not the good way ?
- adgjlsfhk1 4y agoyou can't disallow it at a language level since either way, you are just indexing with Ints. That said, we can add better linting rules to catch stuff like this.
- cmcaine 4y agoI don't think there's any clean way to stop that at a language level (some languages prevent this by disallowing random access to arrays, but that's a non-starter for a performance-oriented language), and also it would be a massively breaking change.