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

KVObject should implement IList<T> #78

Closed
ghost opened this issue Jun 8, 2023 · 3 comments
Closed

KVObject should implement IList<T> #78

ghost opened this issue Jun 8, 2023 · 3 comments

Comments

@ghost
Copy link

ghost commented Jun 8, 2023

I would like to be able to add/remove children to/from a KVObject. I would also like the ability to get the number of children in a KVObject without having to enumerate it.
I suggest having the KVObject class implement the System.Collections.Generic.ICollection<T> and System.Collections.Generic.IList<T> interfaces. This would also enable getting/setting children by index, thus allowing to enumerate via a for loop.

Thank you for considering my suggestion.

@yaakov-h
Copy link
Member

yaakov-h commented Jun 8, 2023

KVObjects were intended to be immutable, but we need to do some work in the space to simplify it for consumers.

See #30 and #21 which already cover improving the API.

@yaakov-h yaakov-h closed this as not planned Won't fix, can't repro, duplicate, stale Jun 8, 2023
@ghost
Copy link
Author

ghost commented Jun 8, 2023

KVObject contains an Add(KVObject) method and an indexer with a set accessor. Correct me if I'm wrong, but doesn't that make it mutable? Why shouldn't removing children be possible?

@yaakov-h
Copy link
Member

yaakov-h commented Jun 8, 2023

intended to be immutable

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

1 participant