lua-users home
lua-l archive

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


> In general the luaL_check* functions deal with transferring data from Lua
> to C, and raise an error if this is not possible. If a value remains in
> Lua, such as a function or a table, it's easier to just use it as if it
> has the type you expect, and allow the lower-level checks to do their job.

This is right, so if the feature would be supported, the macros (or
functions) shall be rewritten to return a C value.
For example:

  #define luaL_checkboolean(L,n)    (luaL_checktype(L, (n),
LUA_TBOOLEAN), lua_toboolean(L, (n))
  #define luaL_checkfunction(L,n)    (luaL_checktype(L, (n),
LUA_TFUNCTION), lua_tocfunction(L, (n))