lua-users home
lua-l archive

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

On 25/10/14 19:59, Roberto Ierusalimschy wrote:
>> 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

I am really sorry, it is me. To be honest, I have generally stayed away
from using the opt/check functions and therefore did not know that
luaL_optinteger etc. have been present for some time, rather than a new
edition to the library.

Sorry for the confusion.


Attachment: signature.asc
Description: OpenPGP digital signature