Bool {post,pre}{inc,dec}-operators

Kyle Furlong kylefurlong at gmail.com
Wed Mar 1 11:30:51 PST 2006


Jeremy wrote:
> In article <du2qrk$61u$2 at digitaldaemon.com>, Kyle Furlong says...
>> Oskar Linde wrote:
>>> bool a = 0;
>>> --a;
>>> assert(a == false || a == true); // FAILS(!) (a is set to 255)
>>>
>>> bool t = true;
>>> bool b = t+t;
>>> assert(b == true); //OK
>>> bool c = 0;
>>> c++;
>>> c++;
>>> assert(c == true || c == false); // FAILS
>>>
>>> But:
>>>
>>> bool d = 0;
>>> d += 2;
>>> assert(d == true || d == false); // OK
>>>
>>> /Oskar
>> This makes me sick to my stomach. I thought D was a beautiful language, but now I dont know.
> 
> bools were *just* added... I'm sure Walter will fix these things -- don't go
> degrading the entire language because a brand new feature in a beta release is
> buggy. Keep up the good work... anyway, how often do you get to yell directly to
> the language's creator to get it made just the way you want it? :-D
> 
> - Jeremy

Here's the thing though: Even if I and others yell and scream and tear our hair out, Walter will implement it how he wants 
anyways. And yes, I sill think D is the best language around. (D the Language, not D the Framework)



More information about the Digitalmars-d-bugs mailing list