[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: use of gettop to change functionality
- From: Roberto Ierusalimschy <roberto@...>
- Date: Tue, 1 Mar 2011 10:58:07 -0300
> static int tinsert (lua_State *L) {
> int e = aux_getn(L, 1) + 1; /* first empty element */
> - [...]
> + int i;
> + int pos = luaL_checkint(L, 2); /* where to insert new element */
> + if (lua_gettop(L) != 3)
> + return luaL_error(L, "wrong number of arguments to " LUA_QL("insert"));
The entire point was not to treat nil and none as the same?
-- Roberto