lua-users home
lua-l archive

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


> On 25/10/14 19:20, Roberto Ierusalimschy wrote:
> >> I also fail to understand the manual which states, "Macros to project
> >> non-default integer types (luaL_checkint, luaL_optint, luaL_checklong,
> >> luaL_optlong) were deprecated. Use their equivalent over lua_Integer
> >> with a type cast (or, when possible, use lua_Integer in your code). "
> >>
> >> Use their equivalent what?
> > 
> >   luaL_checkint -> (int)luaL_checkinteger
> >   luaL_optint   -> (int)luaL_optinteger
> >   etc.
> > 
> > Is that your question?
> > 
> > -- Roberto
> > 
> 
> Thank you, it is yes.
> 
> Do you not think that the manual should mention, in the API change
> section, that these functions are replacements for the deprecated
> luaL_opt* functions or maybe just the fact that they have been introduced?

Maybe I am having a problem with English here (in particular in our
use of "over"); it should be quite clear that the "equivalent over
lua_Integer" of luaL_optint is luaL_optinteger (the same function but
over lua_Integers, instead of over ints). And these functions were
not introduced now; luaL_optlong (and others) was always just a macro:

  #define luaL_optlong(L,n,d)     ((long)luaL_optinteger(L, (n), (d)))

-- Roberto