Open Tokazama opened 4 years ago
Yes, once some ordering semantics of AbstractDictionary
are resolved in #13 I don't see why we can't have array-like dictionaries with ranges as keys.
I don't think implementing this will be too hard - e.g. Indices
can have tokens and lookup can defer to findfirst
for AbstractArray
s, we can set the issettable
and isinsertable
traits accordingly, or something like that... hmm...
I'd ultimately like to incorporate this package into AxisIndices.jl so once #13 is in place I'd be happy to help out with the details of this.
This came up on discourse. It's pretty important to have indices that are mutable for a lot of things methods to work (append!, push!, etc.), but there are times it's worth improving performance and losing mutating functions. I mentioned my work on StaticRanges.jl may be helpful. It provides mutable ranges as well with protective
setproperty!
methods so that users don't accidently make bizarre changes to a mutable range.This could be as simple as:
If this is something you're interested in I'd be interested in further discussing how to implement it.