lua-users home
lua-l archive

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

> For example, luaL_checkudata() used to return NULL if the type didn't
> match but in 5.1 it seems to trigger an error, which is not what I want
> because I just want to check the type not kill the runtime (ie. 5.0
> behaviour seemed better).

No, this behaviour is right (now):

all luaL_check(..) triggers an error (also in lua 5.0), i.e. 
luaL_checkstring, luaL_checknumber etc. so its good to know that
luaL_checkudata does the same for now. This means, i can change
the code

        aUser **UP = luaL_checkudata(L, idx, "User");
        if (!UP)
                luaL_typerror(L, idx, "User");

to a simple

	aUser **UP = luaL_checkudata(L, idx, "User");

or am i wrong?