IterTools.jl icon indicating copy to clipboard operation
IterTools.jl copied to clipboard

reverse iterators for Julia 0.7

Open stevengj opened this issue 6 years ago • 0 comments

Now that 0.7 has reverse iteration (https://github.com/JuliaLang/julia/pull/24187), it would be nice to support that in the IterTools iterators where it makes sense:

  • define Iterators.reverse(itr::SomeIterType) in cases where the reverse iterator is easily written in terms of some other iterator type. (e.g. if itr "wraps" around another iterator, just call Iterators.reverse on the "inner" iterator).

  • define start/next/done methods for Iterators.Reverse{SomeIterType} in cases where you need a specialized iteration protocol.

For examples, see https://github.com/JuliaLang/julia/blob/master/base/iterators.jl

stevengj avatar Nov 29 '17 20:11 stevengj