DMD 0.148 release

Georg Wrede georg at nospam.org
Sun Feb 26 05:02:08 PST 2006


Derek Parnell wrote:
> Walter is still living in the C/C++ past with this concept, which is  
> strange seeing he has implemented so many progressive concepts in D.  
> Boolean as an integer is just retro.

So am I.

Booleans have to be int. A boolean may have any "numeric" value, but if 
  implicitly cast to a numeric type, it should return 1 or 0.

D IS A PRACTICAL PROGRAMMING LANGUAGE.

Forcing booleans to be 1/0 all the way is just academic, purist, 
impractical bigotry. About as smart as having the bit type.

(Besides, if booleans, as some say here, are _only_ abstract concepts, 
then we might as well decide to have 0 mean true and 1 mean false. Heh, 
there's only one truth but millions of lies! But we live in a world with 
other people. And computers.)

Now, specifying 0 to mean false and everything else to mean not-false, 
we go along with the hardware, the computer industry, half a century of 
programming PRACTICE, and make life less difficult for anybody with a 
professional programming background before moving to D.

Anybody who wants a tight-ass boolean, can define one for themselves.

////

Now off to the Olympic Final in ice hockey: Finland - Sweden!!!



More information about the Digitalmars-d-announce mailing list