lua-users home
lua-l archive

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


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