trying to make a simple procedure to modify a variable number of arguments in nim (for example to initialize a number of a variables from input).
proc Read(outputVars: var varargs[int]) =
for v in outputVars.mitems:
v = 3
var
a, b, c : int
Read(a, b, c)
However the compiler doesn't like this and outputs:
Error: type mismatch: got <int, int, int>
but expected one of:
proc Read(outputVars: var varargs[int])
first type mismatch at position: 1
required type for outputVars: var varargs[int]
but expression 'a' is of type: int
expression: Read(a, b, c)
How can I make a procedure that accepts a variable number of mutable arguments?