Skip to content

Removing old iterator methods #215

@kimikage

Description

@kimikage

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions