Skip to content

Commit

Permalink
Use deprecated bindings from Base for deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
ararslan committed Apr 20, 2018
1 parent a1e9df5 commit dfe5968
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions src/DataStructures.jl
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,21 @@ module DataStructures
PriorityQueue(o, zip(ks,vs))
end

@deprecate find(x::Union{SortedDict,SortedSet}, k) findkey(x, k)
@deprecate endof(x::OrderedSet) lastindex(x)
for T in [:IntSet, :Deque, :CircularDeque]
@eval @deprecate shift!(x::$T) popfirst!(x)
if isdefined(Base, :find)
import Base: find
@deprecate find(x::Union{SortedDict,SortedSet}, k) findkey(x, k)
end
for T in [:Deque, :CircularDeque, :CircularBuffer]
@eval @deprecate unshift!(d::$T, x) pushfirst!(d, x)
if isdefined(Base, :endof) && isdefined(Base, :lastindex)
import Base: endof
@deprecate endof(x::OrderedSet) lastindex(x)
end
if isdefined(Base, :shift!) && isdefined(Base, :popfirst!)
import Base: shift!, unshift!
for T in [:IntSet, :Deque, :CircularDeque]
@eval @deprecate shift!(x::$T) popfirst!(x)
end
for T in [:Deque, :CircularDeque, :CircularBuffer]
@eval @deprecate unshift!(d::$T, x) pushfirst!(d, x)
end
end
end

0 comments on commit dfe5968

Please sign in to comment.