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

Implement or Source an ArraySlice #128

Open
mbaker3 opened this issue Oct 21, 2022 · 2 comments
Open

Implement or Source an ArraySlice #128

mbaker3 opened this issue Oct 21, 2022 · 2 comments
Labels
effort-high Focused - 4 to 8 hours priority-medium Standard task, plan as you see fit. status-backlog Tasks captured but not yet planned. type-feature New feature or request

Comments

@mbaker3
Copy link
Member

mbaker3 commented Oct 21, 2022

Inspired by Unity's NativeArraySlice it would be very helpful to have a struct that represents a piece of a standard Array.

Read + Write functionality would be ideal but the ability to read is the most important.

This SO post provides some sample/hint implementations. IList is probably a good starting point.

An example application. TypeExtension.GetReadableNameOfGenericRecursive would have been much nicer if we could pass a new slice into each recursion rather than tracking the upper bound.

Naming is up for debate. ArraySlice, ArrayFragment, PartialArray, etc...

@mbaker3 mbaker3 added effort-high Focused - 4 to 8 hours priority-medium Standard task, plan as you see fit. status-backlog Tasks captured but not yet planned. type-feature New feature or request labels Oct 21, 2022
@tjvezina
Copy link
Contributor

Would LINQ's Skip() and Take() satisfy this? Or does it need to be a reference to the original array?

@mbaker3
Copy link
Member Author

mbaker3 commented Oct 22, 2022

Looking for something lighter weight that can make assumptions that the length won't ever change.
LINQ's dependence on enumerators makes them poor candidates for indexed lookups too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort-high Focused - 4 to 8 hours priority-medium Standard task, plan as you see fit. status-backlog Tasks captured but not yet planned. type-feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants