Delight

Christopher Wright dhasenan at gmail.com
Thu Sep 25 19:50:51 PDT 2008


Johan Granberg wrote:
> bearophile wrote:
> 
>> Mosfet:
>>> Is there any performance loss from compared to D language ?
>> No, it's just D1 resyntaxed. That is, it generally improves on the
>> old-school syntax of D ;-)
>>
>> Bye,
>> bearophile
> 
> How complet is the page? From wath I read there was several good features
> missing from D1 and if it's just a resyntax thats a shame :)
> 
> The most notisable was that I found no mention of an equvivalent to this
> 
> foreach(i,x;collection)
>         doSuff(i,x);
> 
> my experience from java is that not getting access to the index can be a
> real problem.

In C#, I don't care about the index at least 80% of the time. Maybe as 
much as 95%.

That still means I have to turn 1 out of every 20 loops into:
int i = 0;
foreach (Type var in collection)
{
	// do stuff, and then...
	i++;
}


More information about the Digitalmars-d-announce mailing list