DMD 0.148 release

Derek Parnell derek at psych.ward
Sun Feb 26 17:03:21 PST 2006


On Mon, 27 Feb 2006 01:29:07 +0200, Georg Wrede wrote:

>> 
>> Ok, I'll give an example of that right after you give an example of why 
>> and where this is needed/good/(not extremly bad):
>> 
>>   bool a, b, c;
>>   a = true;
>>   b = true;
>>   c = true;
>> 
>>   a = b+c; // true + true is what?
> 
> That's why we do want to have booleans. The whole point of having 
> booleans is to not do that by mistake.

But D currently allows this to happen. It's boolean implementation is
broken.
 
>>   if(5) //if 5 what? what does that mean (except nothing)?
> 
> Ever seen this:
> 
> while(1)
> 
> written in source code?
> 
> Or this:
> 
> c = getCharacter(inf);
> if (c) { /* whatever */ }
> 
> Oh, by the way, just checked how many times 'while(1)' appears in 
> src/phobos/std:
> 
> grep "while *( *1 *)" *.d |wc
> 
> answer: 16 times.

Aren't you reading my posts anymore ;-) 

  while(1)

is shorthand for 

  while (1 != 0)

and 
  c = getCharacter(inf);
  if (c) { /* whatever */ }

is shorthand for 

  c = getCharacter(inf);
  if (c != 0) { /* whatever */ }


-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
"Down with mediocracy!"
27/02/2006 12:00:30 PM



More information about the Digitalmars-d-announce mailing list