Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabling dynamic and fixed indices. #5

Open
Tokazama opened this issue Dec 18, 2019 · 2 comments
Open

Enabling dynamic and fixed indices. #5

Tokazama opened this issue Dec 18, 2019 · 2 comments

Comments

@Tokazama
Copy link

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:

const StaticIndicesRange{T,L} = Indices{T,OneToSRange{T,L}}
const DynamicIndicesRange{T} = Indices{T,OneToMRange{T}}
const FixedIndicesRange{T} = Indices{T,OneTo{T}}

If this is something you're interested in I'd be interested in further discussing how to implement it.

@andyferris
Copy link
Owner

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 AbstractArrays, we can set the issettable and isinsertable traits accordingly, or something like that... hmm...

@Tokazama
Copy link
Author

Tokazama commented Jun 9, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants