Remove complex and imaginary types?

Russell Lewis webmaster at villagersonline.com
Fri Jan 11 08:38:26 PST 2008


Yigal Chripun wrote:
> IMHO both foreach_reverse *and* foreach are ugly hacks and should be 
> removed in D2.

I can see how we might choose to remove foreach_reverse (assuming that 
DMD can properly inline loops...another post suggested that it currently 
could not).

However, I wanted to speak up in favor of foreach(): IMHO, it is an 
exceptionally useful tool because it provides auto-translation of the 
"continue", "break", and "return" semantics.  Can you imagine the syntax 
required to emulate a return out of a loop body if foreach didn't do it 
for you?  Sure, you could do it by hand, but it'd be very ugly. 
foreach() is such a common paradigm that I think that the syntax sugar 
is worth it.  MHO.



More information about the Digitalmars-d mailing list