That’s totally reasonable to hope for, but it won’t work precisely because the suggested code, even if written out by hand, still doesn’t work (it creates global variables, not local ones, because that is inherently how @eval
always works).
The only way for @unpack params
to work would be for the type of params
to be known when the @unpack
macro is expanded, but that’s impossible: if you’re inside a function, the macro will be expanded before the function is run and therefore before params
has a value.