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 no longer supports @current_module, so in this regard every `@macromethod should has a built in current_module variable, right? is there a plan to implement it?
@macromethodobject(head, begin*{body} end) beginparse_head(head)
parse_body(body)
end
body may include macros such as
@object SS begin@stub fun
end
while you are parsing the body , you may want to expand the macro with macroexpand which now takes the expression and the module.
Thanks
The text was updated successfully, but these errors were encountered:
Yes, that's the purpose of #41. I had some trouble compiling julia but that's solved now, so I can finally come back to this. Hopefully I will have 0.7 support very soon.
As for macro-expanding, I think that's best left to the user, because they might want to dispatch on or manipulate macro calls. The __module__ variable can be used:
@macromethodobject(head, begin*{body} end) beginparse_head(macroexpand(__module__, head))
parse_body((x->macroexpand(__module__, x)).(body))
end
Which now that I've typed it out looks pretty ugly, so I might implement some sort of shortcut, like:
local macroexpand(m,x) = Base.macroexpand(m, x)
macroexpand(x) = macroexpand(__module__, x)
At the start of every method or something. (I can probably think of something better)
Julia no longer supports @current_module, so in this regard every `@macromethod should has a built in current_module variable, right? is there a plan to implement it?
body may include macros such as
while you are parsing the body , you may want to expand the macro with macroexpand which now takes the expression and the module.
Thanks
The text was updated successfully, but these errors were encountered: