File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,21 +16,13 @@ Rand(::Type{X}=Float64) where {X} = Rand(GLOBAL_RNG, X)
1616
1717(R:: Rand )(args... ) = rand (R. rng, R. sp, args... )
1818
19- Base. start (R:: Rand ) = R
20-
21- function Base. next (:: Union{Rand,Distribution} , R:: Rand )
22- e = R ()
23- e, R
24- end
25-
26- Base. done (:: Union{Rand,Distribution} , :: Rand ) = false
27-
19+ Base. iterate (iter:: Union{Rand,Distribution} , R:: Rand = iter) = R (), R
2820Base. IteratorSize (:: Type{<:Rand} ) = Base. IsInfinite ()
2921
3022Base. IteratorEltype (:: Type{<:Rand} ) = Base. HasEltype ()
3123Base. eltype (:: Type{<:Rand{R, <:Sampler{T}}} ) where {R,T} = T
3224
3325# convenience iteration over distributions
3426
35- Base. start (d:: Distribution ) = Rand (GLOBAL_RNG, d)
27+ Base. iterate (d:: Distribution ) = iterate ( Rand (GLOBAL_RNG, d) )
3628Base. IteratorSize (:: Type{<:Distribution} ) = Base. IsInfinite ()
You can’t perform that action at this time.
0 commit comments