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).
My understanding of a set is a collection of keys without values. Therefore, I would expect
OrderedSetto havekeysas elements and their positions in the set as values or indices. This interpretation agrees with the description ofBase.getindex: "Retrieve the value(s) stored at the given key or index within a collection."The current implementation of
getindex(ordered_set, i)returns theith element inordered_setwhich 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 useordered_set[i]instead. Similarly, the current implementation ofkeys(ordered_set)returns1:length(ordered_set)instead ofcollect(ordered_set).