1 matches bool, 2 matches long

Jonathan M Davis jmdavisProg at gmx.com
Sat Apr 27 17:59:41 PDT 2013


On Sunday, April 28, 2013 02:53:04 Timon Gehr wrote:
> On 04/28/2013 02:28 AM, Jonathan M Davis wrote:
> > ...  I like
> > being able to do while(1) because it's shorter, ...
> 
> for(;;) is shorter.

True, but I'd never use it, because I'd never use a for loop for anything that 
didn't involve either creating a variable in the first portion of the for or 
doing something in the last portion. I also find it very bizarre that it's 
legal to have a loop _without_ a condition like for(;;) does.

If you couldn't do while(1), I'd do while(true) and never for(;;), but that's 
obviously a matter of preference, and while I like being able to do while(1), 
I'd gladly give it up if that meant that we stopped treating bool as in 
integral type.

- Jonathan M Davis


More information about the Digitalmars-d mailing list