DMD 0.148 release
Derek Parnell
derek at psych.ward
Sun Feb 26 13:45:28 PST 2006
On Mon, 27 Feb 2006 06:05:13 +1100, Georg Wrede <georg at nospam.org> wrote:
> Well, then we could skip the logical operators, right? No more && or ||.
> Since all booleans would be strictly 0 or 1, they'd become obsolete.
Firstly, I'm not saying that booleans are 0 or 1 - they are not even
numbers.
Secondly, '&&' and '||' are logic operations and don't apply to numbers,
they apply to booleans.
if ((a < b) && (c >= b)) ...
has meaning regardless of how booleans are implemented.
> And if booleans have to only be 0 or 1, then a whole lot of unnecessary
> conversions would be happening all over the place. Forget D speed.
I repeat ... why are you saying the 0/1 is the only implementation being
suggested? I'm not holding that position. Booleans can be implemented
efficiently, and the compiler can implement boolean semantics, these are
not mutually exclusive.
> Also, D is supposed to be a _systems_language_ for chrissake! Any kernel
> writing would then have to forgo booleans totally.
Why? Your statement does not make any sense to me.
> I'm all for features in D that enhance productivity, but deliberately
> dumbing down the language is getting a bit too far.
You mean that by making D smarter about the use of booleans would actually
make it dumber?
> We've all had our fights with C, C++, and other related languages. But
> honestly, how many of us can confess to having problems with logical
> values?
Me.
> And if someone here has such problems, I suggest switching to VB.
I am also a VB coder and I'm not a language bigot.
> "Don't fix it if it ain't broke."
D is broken with respect to booleans. A little less broken than before,
but still broken.
--
Derek Parnell
Melbourne, Australia
More information about the Digitalmars-d-announce
mailing list