File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -72,15 +72,20 @@ and_iteratoreltype(a, b) = EltypeUnknown()
72
72
73
73
Given an iterator `itr`, then `reverse(itr)` is an iterator over the
74
74
same collection but in the reverse order.
75
-
76
75
This iterator is "lazy" in that it does not make a copy of the collection in
77
76
order to reverse it; see [`Base.reverse`](@ref) for an eager implementation.
78
77
78
+ (By default, this returns
79
+ an `Iterators.Reverse` object wrapping `itr`, which is iterable
80
+ if the corresponding [`iterate`](@ref) methods are defined, but some `itr` types
81
+ may implement more specialized `Iterators.reverse` behaviors.)
82
+
79
83
Not all iterator types `T` support reverse-order iteration. If `T`
80
84
doesn't, then iterating over `Iterators.reverse(itr::T)` will throw a [`MethodError`](@ref)
81
- because of the missing [ `iterate`](@ref) methods for `Iterators.Reverse{T}`.
85
+ because of the missing `iterate` methods for `Iterators.Reverse{T}`.
82
86
(To implement these methods, the original iterator
83
- `itr::T` can be obtained from `r = Iterators.reverse(itr)` by `r.itr`.)
87
+ `itr::T` can be obtained from an `r::Iterators.Reverse{T}` object by `r.itr`;
88
+ more generally, one can use `Iterators.reverse(r)`.)
84
89
85
90
# Examples
86
91
```jldoctest
You can’t perform that action at this time.
0 commit comments