> There is another case where the Nim compiler uses its knowledge of types to 
> help the programmer: this is the automatic dereferencing of references and 
> pointers.

No, it's just a stylistic decision, one that some people find surprising as it 
is a special case.

Python could have just as well automatically expanded a list into varargs - in 
fact, it has more information at the time of the call than Nim does, being 
dynamic.

If you want to pass just one list argument to a vararg Nim proc, you need to 
call e.g. `printStuff(@[lines])`, because `printStuff(lines)` would ""unwrap"" 
it and provide a list of unknown length; whereas either 
`printStuff(lines,lines)` or `printStuff(@[lines,lines])` would result in an 
argument list of 2 arguments, regardless of the length of lines.

This (apparent) inconsistency is the source of the confusion. Personally, I 
prefer the Python behaviour, but since we're past v1.0, I don't think it's 
worth discussing a breaking change even if everyone agrees with me (And not 
everyone does).

Reply via email to