[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: very simple question about Lua C Function args check
- From: Francesco Abbate <francesco.bbt@...>
- Date: Sat, 27 Nov 2010 16:18:18 +0100
2010/11/27 Drake Wilson <drake@begriffli.ch>:
> In other words, you want to accept up to 3 parameters and treat an
> explicit nil as though it were absent?
>
> An easy and clean way to do that would be to call lua_settop(L, 3)
> near the beginning, adjusting the entire stack (parameter list) to
> exactly 3 slots and filling any trailing unspecified slots with nil.
Ok, I see, so I should use lua_gettop and I should not assume that a
nil argument is the same of an omitted argument (seems reasonable).
The lua_isnoneornil to accees beyond the top of the stack seems awkward...
Thank you for the prompt answer !!
--
Francesco