Since UnPack.@unpack is based on unpack(x, Val(key)) it can lead to a lot of undesired specializations, see e.g. https://github.com/SciML/OrdinaryDiffEq.jl/pull/1893. Therefore I put together a more lightweight macro in https://github.com/devmotion/SimpleUnPack.jl (by design, it has less features than UnPack.jl): the expression is just rewritten to a sequence of getproperty calls without any Val on older Julia versions and to the Base destructuring syntax on Julia >= 1.7.
Since
UnPack.@unpack
is based onunpack(x, Val(key))
it can lead to a lot of undesired specializations, see e.g. https://github.com/SciML/OrdinaryDiffEq.jl/pull/1893. Therefore I put together a more lightweight macro in https://github.com/devmotion/SimpleUnPack.jl (by design, it has less features than UnPack.jl): the expression is just rewritten to a sequence ofgetproperty
calls without anyVal
on older Julia versions and to the Base destructuring syntax on Julia >= 1.7.