Is there a good reason why:
var a, b = 0
var a, b: int
a, b = 0
fails?
Is it possible to assign the same value to multiple defined variable?
In the officical tutorial
Note that declaring multiple variables with a single assignment which calls a procedure can have unexpected results: the compiler will unroll the assignments and end up calling the procedure several times. If the result of the procedure depends on side effects, your variables may end up having different values! For safety use only constant values.
(https://nim-lang.org/docs/tut1.html#the-assignment-statement)
At least tuple assignment works:
var a, b, c: int
echo a, b, c
(a, b, c) = (1, 1, 1)
echo a, b, c
stefan@nuc /tmp/hhh $ ./t
000
111
var a, b = 0
var a, b = 1
echo a,b
#01
var a, b: int
a, b = 0
On my system using Nim 0.18.0 both on Linux and Windows I get:
var a, b = 1
echo a, b
#11