Tim Holy wrote: > This will be a ridiculous charicature, but this issue has come up so many > times that I think a little charicaturization is timely. > > With regards to arrays and views, the "big change" in julia 0.5 will > essentially be a 1-line change: > > getindex(A, indexes...) = slice(A, indexes...) > > Since slice is already in base, you can use it today :-). > > There's much more to it than that: SubArrays don't always check bounds, so > currently this is At Your Own Risk. There are some difficulties in > reshaping SubArrays. > > But if the fundamental question is, "can I have performant and very > flexible views?" the answer is: you already have them. > > Best, > --Tim
To be more precise, I'm coming from python/numpy. There, a native slice: M[1:,2:] for example returns a view, not a copy. As does a strided view: M[::2] I like this design. Does julia do this now, or does it plan to in the future?