[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFA]: BOOL coding standards (Was: Problemwith+numberWithBool:?)
From: |
Alexander Malmberg |
Subject: |
Re: [RFA]: BOOL coding standards (Was: Problemwith+numberWithBool:?) |
Date: |
Wed, 04 Feb 2004 03:11:23 +0100 |
Richard Frith-Macdonald wrote:
> Does anyone really have problems with replacing cases of 'x == YES' with
> isYES(x) where non YES/NO values of x are treated as YES but generate
> a one-time warning?
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.
- Alexander Malmberg
- 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 <=
- Re: [RFA]: BOOL coding standards (Was: Problemwith+numberWithBool:?), Nicola Pero, 2004/02/04
- 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