[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFA]: BOOL coding standards (Was: Problemwith+numberWithBool:?)
From: |
Nicola Pero |
Subject: |
Re: [RFA]: BOOL coding standards (Was: Problemwith+numberWithBool:?) |
Date: |
Wed, 4 Feb 2004 17:14:45 +0000 (GMT) |
> After some discussion in #GNUstep, and in the interest of ending this,
> I'll suggest something that I can live with (although it is on the outer
> fringes of acceptable silliness):
>
> Methods that produce BOOL values must produce only the values 1 (YES) or
> 0 (NO).
>
> Methods that accept BOOL values must handle all non-zero values as true,
> and may use the isYES macro to do so. isYES must, preferably by default,
> but at least optionally, expand to nothing, ie.:
>
> #define isYES(x) (x)
>
> What it expands to in other cases I don't care about, as long as the
> default is reasonably sane.
That looks fine - thanks for trying to settle this down - but I'd prefer
to omit mention of the isYES() macro altogether. What about -
"Methods that produce BOOL values must produce only the values 1 (YES) or
0 (NO).
Handling of BOOL values must handle all non-zero values as true; for this
reason it is better not to compare BOOL values directly with YES, but to
treat all values which are not NO as true."
I suppose the isYES() macro would comply with this, so it would be Ok by
our coding standards.
- Re: [RFA]: BOOL coding standards (Was: Problem with+numberWithBool: ?), (continued)
Re: [RFA]: BOOL coding standards (Was: Problem with+numberWithBool:?), Alexander Malmberg, 2004/02/02
- Re: [RFA]: BOOL coding standards (Was: Problem with+numberWithBool:?), Nicola Pero, 2004/02/02
- Re: [RFA]: BOOL coding standards (Was: Problemwith+numberWithBool:?), Alexander Malmberg, 2004/02/02
- Re: [RFA]: BOOL coding standards (Was: Problemwith+numberWithBool:?), Nicola Pero, 2004/02/02
- Re: [RFA]: BOOL coding standards (Was: Problemwith+numberWithBool:?), David Ayers, 2004/02/03
- Re: [RFA]: BOOL coding standards (Was: Problemwith+numberWithBool:?), Richard Frith-Macdonald, 2004/02/03
- Re[2]: [RFA]: BOOL coding standards (Was: Problemwith+numberWithBool:?), Manuel Guesdon, 2004/02/03
- Re: [RFA]: BOOL coding standards (Was: Problemwith+numberWithBool:?), Alexander Malmberg, 2004/02/04
- Re: [RFA]: BOOL coding standards (Was: Problemwith+numberWithBool:?),
Nicola Pero <=
- Re: [RFA]: BOOL coding standards (Was: Problemwith+numberWithBool:?), David Ayers, 2004/02/04
Re: [RFA]: BOOL coding standards (Was: Problemwith+numberWithBool:?), Alexander Malmberg, 2004/02/03
Re: [RFA]: BOOL coding standards (Was: Problemwith+numberWithBool:?), Richard Frith-Macdonald, 2004/02/03
Re: [RFA]: BOOL coding standards (Was: Problemwith+numberWithBool:?), Alexander Malmberg, 2004/02/03
Re: [RFA]: BOOL coding standards (Was: Problemwith+numberWithBool:?), Kazunobu Kuriyama, 2004/02/03