-
-
Couldn't load subscription status.
- Fork 5.7k
Closed
Labels
bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviormacros@macros@macros
Description
I'm writing a macro tha packs it's parameter and @FILE into a NamedTuple and push it into a Vector, like this:
testvec=Vector{NamedTuple{(:f,:s),Tuple{Int,String}}}()
# push!(testvec,(f=0,s="abc"))
macro testm(a)
return quote
b=a+1
push!(testvec,$(esc(
(f=b,s=@__FILE__)
)))
end
end
@testm 2My think is to try avoiding other ways than esc to prevent f and s from being renamed, or to make b work in escaped environment. However I tried $(esc(b))=a+1 and other escape forms, with none of them succeeded.
Any suggestions?
Metadata
Metadata
Assignees
Labels
bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviormacros@macros@macros