On Tuesday, July 26, 2016 2:31:10 AM CDT Oliver Schulz wrote: > I should have known you already have a (very elegant) solution in your > pocket. :-) I really like your proposed first:last syntax!
As discussed in that issue, the problem is that it may not be workable (it's also very unlikely to be merged for julia 0.5). The "safe" alternative is to modify the parser, although that has the disadvantage that you can't pass constructs with `start` or `end` as arguments to functions---it only works inside of [] brackets, which was what motivated addition of the `@view` macro. Bottom line is that we don't have a good solution to this problem at the moment. Interestingly, it seems likely that one could experiment with https:// github.com/JuliaLang/julia/pull/15750 in a package. If it becomes popular then it might help clarify whether one should move it into base. > Concerning Base._length, I was rather thinking about something for the > average user to use instead of length. For everyday > use, length(linearindices(A)) is just too unwieldy, IMHO. Are you saying we should export what is currently _length? Keep in mind that folks who want to add support for unconventional indices to their own packages can of course make this one-line definition themselves, and then they don't have to worry about whether Base will eliminate or rename it. Best, --Tim
