DataStructures.jl
DataStructures.jl copied to clipboard
OrderedDict missing `last`
OrderedDict provides a first
method but does not provide a last
method:
julia> a = OrderedDict(1 => "a", 2 => "b")
OrderedDict{Int64, String} with 2 entries:
1 => "a"
2 => "b"
julia> first(a)
1 => "a"
julia> last(a)
ERROR: MethodError: no method matching lastindex(::OrderedDict{Int64, String})
Closest candidates are:
lastindex(::Any, ::Any) at ~\scoop\apps\julia\current\share\julia\base\abstractarray.jl:373
lastindex(::Union{SortedDict, SortedMultiDict, SortedSet}) at ~\.julia\packages\DataStructures\izXYB\src\tokens2.jl:19
lastindex(::Number) at ~\scoop\apps\julia\current\share\julia\base\number.jl:90
...
Stacktrace:
[1] last(a::OrderedDict{Int64, String})
@ Base .\abstractarray.jl:473
[2] top-level scope
@ REPL[26]:1