Description
openedon Jul 28, 2019
Given our fundamental indexing axiom b = a[inds]
implies b[j] == a[inds[j]]
, it's important to pay attention to the indices-of-your-indices. (Latest example: https://discourse.julialang.org/t/linearindices-for-non-1-based-indices/26906.) I'm wondering if we need a short, simple syntax for Base.IdentityUnitRange(a:b)
. My favorite options are \tricolonTAB
and \vdotsTAB
, which look like this:
⁝(a, b) = Base.IdentityUnitRange(a:b)
After this you can write 0⁝5
. (\tricolon
has better horizontal centering than \vdots
.) Both of these already have the same operator precedence as :
. Other theoretical alternatives are \brokenbar
and \tdcol
but both currently are not usable as binary operators.
Aside from notation, there's a question about where this should live. Obviously one can define this in a package and hope that it becomes standard. The question here is, is this sufficiently fundamental that it should be in Base? We do not currently have an exported interface to access Base.IdentityUnitRange
but it's pretty essential for an awful lot of generic indexing.