review iteratorsize for all types
as it was done in #85 for Chain
types: Product, Partition, IMap, Iterate (IsInfinite)
I suggest that before adding more iteratorsize support, a final julia v0.4 version be tagged, and the REQUIRE file be updated to need julia 0.5
Iteratorsize is generally functional for 0.4, in its current state, and keeping it compatible makes this in particular much harder
I run into the following problem:
julia> nth(drop(repeatedly(() -> 1), 1), 1)
ERROR: MethodError: no method matching length(::Iterators.RepeatCallForever)
Closest candidates are:
length(!Matched::SimpleVector) at essentials.jl:168
length(!Matched::Base.MethodList) at reflection.jl:256
length(!Matched::MethodTable) at reflection.jl:322
...
in nth(::Base.Drop{Iterators.RepeatCallForever}, ::Int64) at /home/philipp/.julia/v0.5/Iterators/src/Iterators.jl:497
Since this seems to be due to this line: is this an instance of this issue? Because I can replicate it with
julia> applicable(length, drop(repeatedly(() -> 1), 1))
true
julia> length(drop(repeatedly(() -> 1), 1))
ERROR: MethodError: no method matching length(::Iterators.RepeatCallForever)
Closest candidates are:
length(!Matched::SimpleVector) at essentials.jl:168
length(!Matched::Base.MethodList) at reflection.jl:256
length(!Matched::MethodTable) at reflection.jl:322
...
in length(::Base.Drop{Iterators.RepeatCallForever}) at ./iterator.jl:371
julia> Base.iteratorsize(drop(repeatedly(() -> 1), 1))
Base.IsInfinite()
and I think that checking for IsInfinite somehow should prevent this. But I might also have understood the logic wrong, and the behaviour is due to length...
@phipsgabler Please file that separately and I'll fix it today :)
@iamed2 done: #100. Thanks!