[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: strfind "bug"
- From: Edgar Toernig <froese@...>
- Date: Thu, 20 Dec 2001 11:06:53 +0100
Peter Shook wrote:
>
> I call lua_settop with the number of arguments that the function
> expects. This has two benefits: any omitted arguments are set to nil,
> and you can count on arguments being in the correct place relative to
> the top of the stack [...]
... and all argument handling functions stop working.
Sure, you can implement proper argument handling in each C function.
The point is: what is encouraged by the given API? Look at all the
included libraries and you see what kind of argument handling is
used.
The proposed change is easy for the API user: just tell the system
how many arguments you expect. Then use the provided functions to
access them and you get a behaviour that is the same as that of Lua
functions.
Ciao, ET.