-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Printing of macro symbols displays like a macrocall #32354
Comments
Looks like a more general problem:
So there's some code for this, but it's not used inside expressions. |
More entertainment:
|
WIP: Still broken for `Expr(:macrocall, mname)` Fix #32354
So I've got a fix for this over at #23408, but It's worth noting that it dramatically uglifies printing of symbols generated by macro hygiene, even as it makes the resulting julia> macro ugly()
quote
x = 1
y = 2
end
end
@ugly (macro with 1 method)
julia> @macroexpand @ugly
quote
#= REPL[30]:3 =#
$(Symbol("#57#x")) = 1
#= REPL[30]:4 =#
$(Symbol("#58#y")) = 2
end Of course, for non-trivial macros it's a lot worse. |
On the up side, the result of printing such expanded forms is actually valid code with those changes. |
MWE:
This should protect the macro name and print it as a
Symbol("@which")
.The text was updated successfully, but these errors were encountered: