lua-users home
lua-l archive

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




On 7/27/07, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
Your explanation is correct. lua.h provides low-level facilities that
try to allow maximum flexibility. lauxlib.h provides higher-level
facilities for some usual tasks; unlike lua.h, it does not try to be
"complete". Most functions that accept booleans behave (or should
behave?) like Lua: any value but nil/false is true, nil/false is
false. With this interpretation, we do not need a checkboolean, because
any value is valid.

-- Roberto

OK just so I have this strait, I can use the luaL_checkany() function? I guess what I am driving at is the ability to use the parameter as a boolean like in C++. My problem is then I have to do the type conversion. If I use luaL_checkint() I have to cast the value. This doesn't seem as useful as adding the functionality to luaxlib.h. Like you said it provides the higher level and it seems to miss boolean. On the same argument, if you are saying that you don't want to pidgin hole a boolean into a certain type, well the lua_isboolean() has already defined what a boolean should be. I am not trying to argue, just understand the motivation.

--
Regards,
Ryan
RJP Computing