Closed
Description
Currently the very common operation of iterating a Dict's keys in sorted order requires writing the overly verbose sort!(collect(keys(d)))
. This could be abbreviated to sort(keys(d))
by adding a sort
method for KeyIterator
, but do we manually add methods for all relevant functions in Base? What about user-defined functions that make sense for general collection-like types? At some point (IIRC) I proposed making KeyIterator
and ValueIterator
subtypes of AbstractVector
, which would make many things "just work". The trouble is that indexing is O(n); however, I believe that something like @JeffBezanson's ordered dict experiment could make indexing O(1).