[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [MANUAL]: Discrepancy in documentation of lua_type
- From: Dirk Laurie <dirk.laurie@...>
- Date: Tue, 6 Mar 2018 14:25:07 +0200
2018-03-06 12:43 GMT+02:00 Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br>:
>> The sequence of types in the manual does not correspond to the values
>> 0,1,2,... as defined in lua.h.
>
> You're supposed to use the symbolic constants LUA_TNIL, LUA_TNUMBER,
> etc., not the actual values.
I realize that. Also that I am supposed to use luaL_typename when
printing out a type value. And that there is LUA_NUMTAGS to tell me
where to stop in a `for`.
I also know that it is a bit of a tradition to require Bourbakian
hairsplitting ability for determining what the manual says and what it
does not. Also that what it should say is neither here nor there.
Moreover, when someone else criticizes the manual for being
insufficiently informative, I usually take the point of view that. to
the careful reader. it is informative enough.
BUT ...
Why, if we are supposed to use symbolic constants, is LUA_TNIL (0)
explicitly mentioned as the first? And given that it is, can the
reader then be blamed for expecting the rest to follow consecutively?