Re: Memoizing Functions - yet another attempt
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Memoizing Functions - yet another attempt
- From: Philipp Janda <siffiejoe@...>
- Date: 2013年12月16日 02:31:23 +0100
Am 16.12.2013 02:04 schröbte Sven Olsen:
The argument tree approach can also be expanded to handle nil argument or
nil return values; though doing so requires a small C-api function.
static int count_args(lua_State * L) {
lua_pushnumber(L,lua_gettop(L));
return 1;
}
This is pretty much what `select( '#', ... )` does[1] ...
[1]: http://www.lua.org/source/5.2/lbaselib.c.html#luaB_select
-Sven
Philipp