-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Description
My understanding of a set is a collection of keys without values. Therefore, I would expect OrderedSet to have keys as elements and their positions in the set as values or indices. This interpretation agrees with the description of Base.getindex: "Retrieve the value(s) stored at the given key or index within a collection."
The current implementation of getindex(ordered_set, i) returns the ith element in ordered_set which is opposite to this interpretation. I agree that it's useful to get the element at a given position, but it's more intuitive to use ordered_set[i] instead. Similarly, the current implementation of keys(ordered_set) returns 1:length(ordered_set) instead of collect(ordered_set).
Metadata
Metadata
Assignees
Labels
No labels