lua-users home
lua-l archive

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


On 22 July 2011 21:10, Peter Odding <peter@peterodding.com> wrote:
>>    bool are_you_sure = luaL_checkboolean( L, 1 );

>  bool are_you_sure = lua_toboolean(L, 1);
>
> Insisting on a value of type boolean doesn't add any value IMHO; Lua
> generally doesn't do strict type checking so why bother with it here?

Ah, right. I had understood from PIL p.223 that lua_toboolean()
returns 0 if the type of the object is not boolean, but the reference
manual is clearer on this point.

Thanks

    M