gnustep-dev
[Top][All Lists]
Advanced

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

Re: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?)


From: Nicola Pero
Subject: Re: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?)
Date: Mon, 2 Feb 2004 05:32:20 +0000 (GMT)

> > I think a BOOL variable should take the values 0 for NO and 1 for YES.
> >
> > Coding standards should recommend that all code writing or returning a
> > BOOL always uses 0 for NO and 1 for YES, as everyone knows and agrees  
> > on
> > those values and their meanings.
> 
> OK, this time I checked ;-)
>     
> http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/ 
> 5objc_language_summary/chapter_10_section_3.html#//apple_ref/doc/uid/ 
> 20001428/TPXREF102
> 
> Why do you think that YES evaluates to "1"? This is a completely  
> arbitary choice, YES could as well be defined like -1 or 5 or 100.

Ok.  Then we could just say that a boolean should take the value YES or
NO. :-)





reply via email to

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