gnustep-dev
[Top][All Lists]
Advanced

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

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


From: Kazunobu Kuriyama
Subject: Re: [RFA]: BOOL coding standards (Was: Problemwith+numberWithBool:?)
Date: Wed, 04 Feb 2004 08:25:42 +0900
User-agent: Mozilla/5.0 (X11; U; Linux i686; ja-JP; rv:1.4) Gecko/20030624 Netscape/7.1

Richard Frith-Macdonald wrote:


On 3 Feb 2004, at 15:38, Alexander Malmberg wrote:

Nicola Pero wrote:

The Objective-C manual of NeXTstep 3.3 clearly states -

[snip
BOOL A boolean value, either YES or NO"

This precise definition

[snip]

This isn't anywhere close to being a precise definition!


To me, it's clear enough what it means.  It means a BOOL is meant to be
either YES or NO. :-)


Sure, to you, but that's because you choose to read that into the
statement, not because it says so. :)


Come on, stop trying to con Nicola into believing he can't read english :-)

Neither, I... :-)

Seriously ... the language is perfectly clear and you can't accuse him/me of
reading anything into it.

True, by the specification, BOOL has two possible values.  But I don't
think it requires we need to #define YES 1, though it is methematically
sound (and I don't like to see any other definitions).  However, after all,
since that is a preprocessor macro, our compiler doesn't care for our
intention at all.  What the compiler can do is to tell zero from non-zero
when it wants to see a true boolean value (I mean, off course, a rough
sketch of the C language specification. )

So I don't think the disscussion of Alexander Malmberg is either pedantic
or academic.  The behavior of the compiler is an important reality
we have to pay attention to.  Relying only on the mathematical definition
rather looks pendantic as well, though I don't say it is wrong.

Extending this thread further is not my intention.  Just wanted to say,
don't ignore our compiler, please.

- Kazunobu Kuriyama

P.S.  Even in mathematics, "false=0 and truth=1" is a convention, not
an axiom.  You can use arbitrary two distingushable symbols to construct
binary logic.






reply via email to

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