@@ -143,12 +143,21 @@ module DataStructures
143143 PriorityQueue (o, zip (ks,vs))
144144 end
145145
146- @deprecate find (x:: Union{SortedDict,SortedSet} , k) findkey (x, k)
147- @deprecate endof (x:: OrderedSet ) lastindex (x)
148- for T in [:IntSet , :Deque , :CircularDeque ]
149- @eval @deprecate shift! (x:: $T ) popfirst! (x)
146+ if isdefined (Base, :find )
147+ import Base: find
148+ @deprecate find (x:: Union{SortedDict,SortedSet} , k) findkey (x, k)
150149 end
151- for T in [:Deque , :CircularDeque , :CircularBuffer ]
152- @eval @deprecate unshift! (d:: $T , x) pushfirst! (d, x)
150+ if isdefined (Base, :endof ) && isdefined (Base, :lastindex )
151+ import Base: endof
152+ @deprecate endof (x:: OrderedSet ) lastindex (x)
153+ end
154+ if isdefined (Base, :shift! ) && isdefined (Base, :popfirst! )
155+ import Base: shift!, unshift!
156+ for T in [:IntSet , :Deque , :CircularDeque ]
157+ @eval @deprecate shift! (x:: $T ) popfirst! (x)
158+ end
159+ for T in [:Deque , :CircularDeque , :CircularBuffer ]
160+ @eval @deprecate unshift! (d:: $T , x) pushfirst! (d, x)
161+ end
153162 end
154163end
0 commit comments