How to make a vector of symbols using a macro

I think the insight you’re missing is how to use QuoteNode to deal with the distinction between symbols (since every identifier is just a symbol in an Expr object) and quoted symbols:

macro foo()
    Expr(:vect, QuoteNode(:x1), QuoteNode(:x2))
end
1 Like