You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi - as mentioned I am trying to benchmark ResumableFunctions against other iteration protocols. The following below is something that is a bit on the simplistic side but reasonably close to a recent use-case I had. The println statements are for debugging since I got strange results.
using ResumableFunctions
using BenchmarkTools
@resumablefunctiong(N)::Vector{Int}for n =1:N
println()
println(n)
for n1 =1:10, n2 =1:10print("*")
# do something not terribly expensive
x =rand(-10:10, 3)
@yield x
endend
Int[]
endf_resumable(N) =sum( sum(x) for x ing(N) )
f_resumable(100)
On Python-generators-v0.6 I get
1
*
as output which just means that it terminates after the first @yield. Why?
When I use the release for v0.6, the I get
1
*ERROR: UndefVarError: #temp# not defined
Stacktrace:
[1] macro expansion at /Users/ortner/.julia/v0.6/ResumableFunctions/src/transforms.jl:14 [inlined]
[2] (::##662)(::Void) at /Users/ortner/.julia/v0.6/MacroTools/src/utils.jl:12
[3] next at ./generator.jl:44 [inlined]
[4] mapfoldl_impl(::Base.#identity, ::Base.#+, ::Int64, ::Base.Generator{##662,Base.#sum}, ::UInt8) at ./reduce.jl:42
[5] mapfoldl(::Base.#identity, ::Function, ::Base.Generator{##662,Base.#sum}) at ./reduce.jl:73
[6] f_resumable(::Int64) at ./REPL[4]:1
which is probably related.
(just in case this turns out to be a stupid bug at my end, let me just apologise profusely in advance . . .)
The text was updated successfully, but these errors were encountered:
Hi - as mentioned I am trying to benchmark ResumableFunctions against other iteration protocols. The following below is something that is a bit on the simplistic side but reasonably close to a recent use-case I had. The
println
statements are for debugging since I got strange results.On
Python-generators-v0.6
I getas output which just means that it terminates after the first
@yield
. Why?When I use the release for v0.6, the I get
which is probably related.
(just in case this turns out to be a stupid bug at my end, let me just apologise profusely in advance . . .)
The text was updated successfully, but these errors were encountered: