Do we need "foreach"?

terranium spam at here.lot
Mon Apr 28 01:11:16 PDT 2008


> Just started wondering why we really need the foreach keyword.
> 
> These two
> 
> for( x ; y ; z )
> 
> for( x ; y )
> 
> do no seem to be ambiguous to me.

does D allow for(x;y)? I think it's easy to remember - if you need foreach, use foreach, normally you sould use foreach where you can, and you will need for only for some rare advanced processing, which can't be done with foreach.



More information about the Digitalmars-d mailing list