-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Labels
arrays[a, r, r, a, y, s][a, r, r, a, y, s]
Description
Looping over 1:length(a) is wrong for AbstractVector because it fails for non 1-based arrays. eachindex(a) is correct, but occasionally you need to provide explicit indices, e.g. to loop only over odd indices as in #23267. start(a):endof(a) doesn't work because for views start(a) is a tuple. You can do first(eachindex(a)), but this is kind of klunky and non-obvious.
Can we export a function startofbeginof(a) = first(eachindex(a)) analogous to endof(a)?
Metadata
Metadata
Assignees
Labels
arrays[a, r, r, a, y, s][a, r, r, a, y, s]