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: Alexander Malmberg
Subject: Re: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool:?)
Date: Tue, 03 Feb 2004 17:02:45 +0100

"Pascal J.Bourguignon" wrote:
>     - 100% correct and "conforming" code should not generate BOOL
>       values other than in {YES,NO}.

Disagreed. BOOL b=5; is perfectly valid code.

>     - 100% correct and "conforming" code should not compare a BOOL
>       value, it should test it as: if(bool_value) or
>       if([obj isSuchAndSuch]), etc.

Disagreed. Not comparing, or comparing against NO, are both correct.
It's comparing against YES which is broken.

>     - legacy code could compare a BOOL  value with YES or NO to detect
>       "non-conforming" code.

Such code is not non-conforming. There's nothing to detect.

>     - the next version should use #define BOOL _Bool

No. However, this isn't directly related.

- Alexander Malmberg




reply via email to

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