> It really works ! It seems that there must be at least at least one value for
> the varargs. Interesting !
It really works ! even without the `@`. The manual says about varargs:
> This transformation is only done if the varargs parameter is the last
> parameter in the procedure header.
It should be updated...
This already works.
proc blabla(arg1: int, arg2: varargs[char], arg3: int) =
echo arg1, @arg2, arg3
blabla 3, 'd', 'e', 's', 'a', 7
Run
Multiple varargs are also supposed to be disallowed, [see
issue](https://github.com/nim-lang/Nim/issues/19332).
Beyond that question, I'm asking myself if it's necessary to always put a
varargs at the end. I think that while there is only one varargs allowed per
proc, we can avoid undecidable situations.
I imagine a Nim where:
* You can pass only one varargs[T] to a proc
* You must pass at least enou
`openArray`.
Hello world. Since a varargs[T] most be the last argument of its function, is
there any way to pass a block to a template that uses varargs ? For exemple is
it possible to write a version of `withLock` that acquires several locks at
once ?
import locks
var
lk1, lk2,