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
julia> macro foo()
quote
call(f) = f((1, 2))
function $(esc(:foo))()
call() do (a, b)
return a+b
end
end
end
end
@foo (macro with 1 method)
julia> @foo
foo (generic function with 1 method)
julia> foo()
3
julia> a
1
julia> b
2
julia> @macroexpand @foo
quote
#= REPL[1]:3 =#
var"#7#call"(var"#8#f") = begin
#= REPL[1]:3 =#
var"#8#f"((1, 2))
end
#= REPL[1]:4 =#
function foo()
#= REPL[1]:4 =#
#= REPL[1]:5 =#
var"#7#call"() do (Main.a, Main.b)
#= REPL[1]:6 =#
return Main.a + Main.b
end
end
end
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: