Can I set iterator index? #95
Labels
No labels
bug
discussion
documentation
duplicate
ignore
new feature
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
golibs/gms-gods#95
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Not at the moment, but somebody proposed something interesting:
All three, including yourself, are asking for the same thing more or less, i.e. the ability to get the iterator from a specific location. For key-value structures that's the key, for others perhaps the index.
Not sure if I will call it
list.IteratorAt(1)/tree.iteratorAt('someKey')orseek(), but this will definitively be implemented in future! Keeping this issue open until it's implemented on all structures that can be iterated.I think making setter method in iterator is better than
IteratorAt()orseek()What do you think?@mcauto I don't have a strong opinion on either.
so
SetIndex()andSetKey()would move the iterator to the given index/key, right?#189 Implements the NextTo iterator function.
@mcauto please let me know if the below implements the requested functionality so that I can reopen this issue:
PS. I hope that this NextTo function can support the requested functionality rather than adding more functions (SetIndex and SetKey). The reason is to keep GoDS as minimal as possible and yet flexible. But please let me know if it is not what you asked for and I'll reevaluate again, adding SetIndex and SetKey is simple