Skip to content

Commit 50636d2

Browse files
committed
remove "where" syntax, for 0.5 compatibility
1 parent 0f851df commit 50636d2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/Primes.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ Base.done(np::NextPrimes, state) = false
682682
Base.iteratorsize(::Type{<:NextPrimes}) = Base.IsInfinite()
683683
Base.iteratoreltype(::Type{<:NextPrimes}) = Base.HasEltype() # default
684684

685-
Base.eltype(::Type{NextPrimes{T}}) where {T} = T
685+
Base.eltype{T}(::Type{NextPrimes{T}}) = T
686686

687687
"""
688688
nextprimes(start::Integer)
@@ -698,7 +698,7 @@ nextprimes(start::Integer) = NextPrimes(start)
698698
Returns an iterator over all primes, with type `T`.
699699
Equivalent to `nextprimes(T(1))`.
700700
"""
701-
nextprimes(::Type{T}) where {T<:Integer} = nextprimes(one(T))
701+
nextprimes{T<:Integer}(::Type{T}) = nextprimes(one(T))
702702
nextprimes() = nextprimes(Int)
703703

704704
"""
@@ -716,7 +716,7 @@ julia> nextprimes(10, 3)
716716
17
717717
```
718718
"""
719-
nextprimes(start::T, n::Integer) where {T<:Integer} =
719+
nextprimes{T<:Integer}(start::T, n::Integer) =
720720
iterate(x->nextprime(add(x, 1)), nextprime(start), n)
721721

722722
struct PrevPrimes{T<:Integer}
@@ -730,7 +730,7 @@ done(np::PrevPrimes, state) = state == 2
730730
iteratorsize(::Type{<:PrevPrimes}) = Base.SizeUnknown()
731731
iteratoreltype(::Type{<:PrevPrimes}) = Base.HasEltype() # default
732732

733-
eltype(::Type{PrevPrimes{T}}) where {T} = T
733+
eltype{T}(::Type{PrevPrimes{T}}) = T
734734

735735
"""
736736
prevprimes(start::Integer)
@@ -767,11 +767,11 @@ julia> prevprimes(10, 3)
767767
3
768768
```
769769
"""
770-
prevprimes(start::T, n::Integer) where {T<:Integer} =
770+
prevprimes{T<:Integer}(start::T, n::Integer) =
771771
iterate(x->prevprime(add(x, -1)), prevprime(start), n)
772772

773-
function iterate(f, x::T, n::Integer) where T
774-
v = Vector{T}(n)
773+
function iterate(f, x, n::Integer)
774+
v = Vector{eltype(x)}(n)
775775
n != 0 && (@inbounds v[1] = x)
776776
@inbounds for i = 2:n
777777
x = f(x)

0 commit comments

Comments
 (0)