lua-users home
lua-l archive

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


> -----Original Message-----
> From: lua-l-bounces@lists.lua.org [mailto:lua-l-bounces@lists.lua.org]
> On Behalf Of liam mail
> Sent: woensdag 30 mei 2012 16:11
> To: Lua mailing list
> Subject: Re: Ref manual; boolean results on c api
> 
> On 11 May 2012 09:17, Thijs Schreijer <thijs@thijsschreijer.nl> wrote:
> > While I'm at it with the refman;
> >
> >
> >
> > There seems to be an inconsistency in how boolean results described
> in the
> > reference manual; mostly they are referenced as a 0 or 1 value, but
> in a few
> > cases it is just 'boolean'. When just starting with c, I got confused
> using
> > the lua_pushboolean() function, that's why I noticed it.
> >
> >
> >
> > Quickly ran through the manual, these are the ones I found not
> explicitly
> > defining what the Boolean value is supposed to be;
> >
> > lua_gc; description of LUA_GCISRUNNING
> >
> > lua_pushboolean
> >
> > lua_tointegerx
> >
> > lua_tonumberx
> >
> > lua_tounsignedx
> >
> >
> >
> > and yes, I know this is taking nitpicking to a whole new level, so do
> with
> > it as you like
> >
> >
> >
> > Thijs
> 
> Anyone using the C API should already understand that a boolean has
> only two values (unless you are Microsoft) with zero being false and
> none zero being true.
> 
> Liam

Obviously I'm aware that a boolean can only hold true, false and maybe,
though straight from the beginning it wasn't clear that in C they were
represented by integer values 1, 0 and 42.

The (very minor) point is; the manual is not consistent. And now we managed
to advance the nitpicking to yet another level (which is noteworthy by
itself).