Given a tuple of variable names, what is the simplest/best way to create an expression which assigns them through destructuring?
For example, given names = (:a, :b, :c)
, create the expression a,b,c, = mytuple
using the variable names
.
Ok, I think I found it:
:(($(names...),) = mytuple)
DrChainsaw has marked this topic as resolved.
Last updated: Nov 22 2024 at 04:41 UTC