There is no reason to use a special syntax to tell the compiler that expansion 
is needed. Thanks to static typing, the compiler is able to see if the array or 
sequence must be transmitted as a whole to the procedure or must be expanded.

In Python, you need a special syntax. Given a function _def f(*x)_ and a list 
_lst_ , if you write _f(lst)_ , _x_ will be a tuple whose first (and only) 
elements will be _lst_. You have to use the special syntax _f(*x)_ to transmit 
each element of _lst_ as an individual argument and, in this case, _x_ will 
contain the elements of _lst_ and not the whole list.

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. Given a _ref object_ , when accessing a field _a_ via a reference _p_ 
, you write _p.a_ and the compiler knows that it must dereference _p_. In C, 
you would have to write something like _(*p).a_ or _p- >a_.

Reply via email to