lua-users home
lua-l archive

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


On 21 Feb 2013, at 19:40, Marc Lepage wrote:

> Is that a good idea in cases like this? Or would the extra settop not be worth the effort?

If I am writing a function which should be called with n params, the first thing I do is lua_settop(l, n). That way I don't have to worry if any params have been missed, as they'll now be on the stack with a nil value, I only have to check their type.

Don't know if it's a good idea, but it's what I always do, Iand so far 've not found any problems.

Thanks,
Kev