JuliaMath / FixedPointNumbers.jl

fixed point types for julia

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Removing old iterator methods

kimikage opened this issue · comments

The start, next and done functions were used in iterators prior to Julia v0.7.

# The main subtlety here is that iterating over N0f8(0):N0f8(1) will wrap around
# unless we iterate using a wider type
@inline start(r::StepRange{T}) where {T <: Normed} = widen1(reinterpret(r.start))
@inline next(r::StepRange{T}, i::Integer) where {T <: Normed} = (T(i,0), i+reinterpret(r.step))
@inline function done(r::StepRange{T}, i::Integer) where {T <: Normed}
i1, i2 = reinterpret(r.start), reinterpret(r.stop)
isempty(r) | (i < min(i1, i2)) | (i > max(i1, i2))
end

These methods were already decoupled from Base two years ago (cf. PR #112). Also, Range has been fixed in PR #163.
I should have noticed when I was reviewing PR #163 that they are probably fine to be removed. Since they are no longer exported, I don't think a deprecation notice is necessary.