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
While working on updating the docs, I came across something really weird:
julia>using JuliaInterpreter
julia>@breakpointsum([1, 2]) any(x->x>4, a)
breakpoint(sum(a::AbstractArray) in Base at reducedim.jl:648, line 648)
julia> val =@interpretsum([1,2,3])
6
julia> val
6
julia> frame, bp =@interpretsum([1,2,5])
(Frame forsum(a::AbstractArray) in Base at reducedim.jl:648
c 16481 ─ nothing2648 │ %2= (Base.#sum#550)(Colon(), #self#, a)3648 └── return%2
a = [1, 2, 5], breakpoint(sum(a::AbstractArray) in Base at reducedim.jl:648, line 648))
julia> frame
ERROR: UndefVarError: frame not defined
julia> bp
ERROR: UndefVarError: bp not defined
julia> x, y =begin
(1, 2)
end
(1, 2)
julia> x
1
julia> y
2
julia>macroexpand(Main, :(frame, bp =@interpretsum([1, 2])))
:((frame, bp =begin#= /home/tim/.julia/dev/JuliaInterpreter/src/construct.jl:633 =##11#theargs = (sum, a)#= /home/tim/.julia/dev/JuliaInterpreter/src/construct.jl:634 =##12#frame = (JuliaInterpreter.JuliaInterpreter).enter_call_expr((JuliaInterpreter.Expr)(:call, #11#theargs...))#= /home/tim/.julia/dev/JuliaInterpreter/src/construct.jl:635 =#if#12#frame === JuliaInterpreter.nothing#= /home/tim/.julia/dev/JuliaInterpreter/src/construct.jl:636 =#return (JuliaInterpreter.eval)((JuliaInterpreter.Expr)(:call, (JuliaInterpreter.map)(JuliaInterpreter.QuoteNode, #11#theargs)...))end#= /home/tim/.julia/dev/JuliaInterpreter/src/construct.jl:638 =#if (JuliaInterpreter.shouldbreak)(#12#frame, 1)#= /home/tim/.julia/dev/JuliaInterpreter/src/construct.jl:639 =#return (#12#frame, (JuliaInterpreter.BreakpointRef)((#12#frame).framecode, 1))end#= /home/tim/.julia/dev/JuliaInterpreter/src/construct.jl:641 =##13#ret = (JuliaInterpreter.finish_and_return!)(#12#frame)#= /home/tim/.julia/dev/JuliaInterpreter/src/construct.jl:642 =#if#13#ret isa JuliaInterpreter.BreakpointRef
(#12#frame, #13#ret)else#13#retendend))
julia>
If you access ans then you can get both frame and bp, but collecting them by ordinary means seems not to work. Do you understand this at all?
The text was updated successfully, but these errors were encountered:
While working on updating the docs, I came across something really weird:
If you access
ans
then you can get bothframe
andbp
, but collecting them by ordinary means seems not to work. Do you understand this at all?The text was updated successfully, but these errors were encountered: