It's very handy to have a shortcut for parameter unpacking/destructing as in code below. A tiny thing, but it's very useful.
Any plans to have something like that in future versions of Nim?
type Person = (string, string)
proc hi((name, family): Person): string = "Hi " & name & " " & family
echo hi(("John", "Smith"))
Currently you have to write code like this:
type Person = (string, string)
proc hi(person: Person): string =
let (name, family) = person
"Hi " & name & " " & family
echo hi(("John", "Smith"))
My custom unpacking library has a macro for this. Although it feels pretty pointless to me I first wrote it as a comment in some RFC and it got like 1 or 2 upvotes so I added it. Syntax is subjective sometimes anyway. The argument to unpackArgs doesn't have to be like [(a, b): tup], if you look in the source of the macro it will even accept something like {(a, b) = tup}. You have to do property unpacks like (name: name) instead of {name} in my library, though I might add this as a rule to curly braces as I don't have any defined behavior on them.
There are other libraries for unpacking too, but I don't think any of them have unpackArgs (as trivial as it is), if they do have something like it then it's probably something like a full blown custom =>-like macro.
I would go with:
type Person = tuple[name, family: string]
proc hi(p: Person): string = "hi " & p.name & " " & p.family