-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Locals in anonymous functions #25
Labels
bug
Something isn't working
Comments
Hi chad, :(map(x -> x^2, 1:3)) |> MacroTools.prettify |> simplify_ex |> solve_from_local |> unwrap_scoped
|
Thanks, now this works great! julia> using MLStyle, JuliaVariables
julia> import MacroTools
julia> unwrap_scoped(ex) =
@match ex begin
Expr(:scoped, _, a) => unwrap_scoped(a)
Expr(head, args...) => Expr(head, map(unwrap_scoped, args)...)
a => a
end
unwrap_scoped (generic function with 1 method)
julia> :(map(x -> x^2, 1:3)) |> MacroTools.prettify |> simplify_ex |> solve_from_local |> unwrap_scoped
:((@global map)(function (x,)
(@global ^)(@local x, 2)
end, (@global :)(1, 3))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @thautwarm, am I using this wrong, or is this a bug?
I'd expect the
x
to be local. I also see this behavior indo
notation.Some context: cscherrer/Soss.jl#253
The text was updated successfully, but these errors were encountered: