gnustep-dev
[Top][All Lists]
Advanced

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

Re: Problem with +numberWithBool: ?


From: Pascal J . Bourguignon
Subject: Re: Problem with +numberWithBool: ?
Date: Sat, 31 Jan 2004 00:15:35 +0100

Alexander Malmberg writes:
> Nicola Pero wrote:
> > > It isn't an implementation detail since it means that BOOL isn't a true
> > > boolean type. Compare this with c99's _Bool, which is a true boolean
> > > type:
> > 
> > It's nice you mention the c99's boolean type; I suppose it would make
> > sense to try have BOOL as compatible as possible with the c99's bool type,
> > hoping that at some point they will be merged.
> 
> I disagree. BOOL isn't a true boolean, and should remain that way. Those
> who want to use _Bool in their own code can just go ahead and do that
> (it'll interoperate just fine with BOOL).
> 
> If, at some point in the distant future, BOOL falls out of use and c99
> is supported everywhere, we could redefine GNUstep's interface using
> _Bool, and deprecate and later remove BOOL completely.

It seems to be that if an OpenStep implementation defined:

   #define BOOL _Bool
   #define NO   0
   #define YES  1

it would be a "conformant" OpenStep implementation.


Indeed, up to  now, BOOL was defined as a type  unsigned char, but the
only "legal" values  for it have always been defined  as being YES (1)
and NO (0).  Any code that would store in a BOOL something else should
be declared non  conformant, and the sooner we  detect (break) it, the
better.


-- 
__Pascal_Bourguignon__                     http://www.informatimago.com/
There is no worse tyranny than to force a man to pay for what he doesn't
want merely because you think it would be good for him.--Robert Heinlein
http://www.theadvocates.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]