-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Labels
macros@macros@macros
Description
In julia 0.7, escaping with esc seems to be stripped out later than in julia 0.6.
This means that macros which are called by other macros need to have code for
dealing with input ASTs including Expr(:escape, ...). For example:
macro a(ex)
# ex will be Expr(:escape, :(x=10)) on julia 0.7, but :(x=10) on 0.6.
@show ex
esc(ex)
end
macro b(ex)
quote
@a $(esc(ex)) # esc() required for julia 0.6.0
#@a $ex # Can be used in 0.7.0-DEV.1300
end
end
@b x=10
xIs this intentional? From a user perspective the 0.6 behavior made more sense
to me, as it allowed the inner macro to work with surface syntax not including
Expr(:escape, ...) nodes. It also meant that the outer macro would be required
to properly escape $ex in the example above.
Metadata
Metadata
Assignees
Labels
macros@macros@macros