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
It's possible to embed a function (not a symbol that represents the function) in an expression and execute it. It seems like it should also be possible to embed a function in an expression and define a new method for it.
julia>f() =1
f (generic function with 1 method)
julia>eval(:($f()))
1
julia>eval(:(f() =2))
f (generic function with 1 method)
julia>f()
2
julia>eval(:($f() =3))
ERROR: syntax: invalid function name "Main.f"# Actual
f (generic function with 1 method) # Desired
julia>f()
2# Actual3# Desired
The text was updated successfully, but these errors were encountered:
That's not something we really support since the frontend will never emit such expressions. Resolved bindings like this will be represented as GlobalRefs instead.
It's possible to embed a function (not a symbol that represents the function) in an expression and execute it. It seems like it should also be possible to embed a function in an expression and define a new method for it.
The text was updated successfully, but these errors were encountered: