I have a macro that looks like this
macro multishift(L...)
ex = :(0)
for d in L
ex = :($ex | 1 << Int32($d))
end
return ex
end
So @multishift(1,2) will expand out to 0 | 1 << Int32(1) | 1 << Int32(2). Now I add a function like so, and call it:
f(L...) = @multishift(L...)
println(f(1,2))
This won't work. I'll get an error that L is not defined. I can see what is happening here - the macro is being expanded out with L instead of the tuple (1,2).
What is the correct way to get around this?