Unless I've missed it, it seems like nim doesn't offer a "splat" operator for 
unpacking (some) collections. In Python, they use asterisks, see 
[PEP448](https://www.python.org/dev/peps/pep-0448/). In Julia, there is a 
[ellipsis 
operator](https://docs.julialang.org/en/v1/manual/faq/#The-two-uses-of-the-...-operator:-slurping-and-splatting)
 for "slurping" and "splatting". We need not adopt such onomatopoeic names, I'm 
happy to just have a civilized "unpacking" operator ;)

This thread is to gather potential interest and maybe for smarter people to 
outline how it would work or what the limitations would be.

There was some similar discussion 
[here](https://forum.nim-lang.org/t/7072#44562) which points to a bunch of 
solutions that people have come up with already. I haven't checked them much 
yet, but they are probably worth a look. For this thread, I'm talking about 
having either one of these or something similar in the stdlib, probably in 
`sequtils` unless there's a better namespace.

Links for le monsieur:

  * <https://github.com/technicallyagd/unpack>
  * <https://github.com/hlaaftana/assigns>
  * <https://play.nim-lang.org/#ix=3LP8>


Reply via email to