Strangely, the Lua API doesn't provides a function like luaL_checkboolean(). This little function add this one.