lua-users home
lua-l archive

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


I can't believe the following is the best way of not happily
accepting pi=3 etc. Too many calls to genuine functions as
distinct from macros.

#define reallycheckint(L,index) (\
  lua_pushinteger(L,luaL_checkint(L,index)),\
  luaL_argcheck(L,lua_compare(L,index,-1,LUA_OPEQ),index,"expected integer"),\
  lua_pop(L,1), lua_tointeger(L,index) )

But every time I try to improve on it I need to store something
in a C variable.