lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Wed, Jun 13, 2012 at 07:39:40PM +0200, Dirk Laurie wrote:
> There is also the possibility of a mixture.  For example, only today
> I wrote a function that can be called this way:
> 
>    subst { expr, x=1, y=2, z=3 }
> 
> The great thing about the fact that this is legal in Lua is that the
> number and the names of the extra parameters may vary.  It's way more
> powerful than the named parameters of Python etc, in which the names
> have to be predictable.

A bit off-topic, but you can do extra named parameters in Python too with
**kwargs.

Regards,

Chris