Remove complex and imaginary types?

naryl cy at ngs.ru
Thu Jan 10 17:25:42 PST 2008


On Fri, 11 Jan 2008 04:03:46 +0300, bearophile <bearophileHUGS at lycos.com>  
wrote:

> naryl:
>> Why don't we remove or at least shorten foreach_reverse too?
>
> Removing: -1. It's actually useful (I'd like to see more iteration  
> constructs, not less).
>
> Shortening: it's long, so maybe yes, if you/someons find(s) something  
> better. Do you have some suggestions?
>
> Bye,
> bearophile

Let me quote Regan Heath:

In article <opsmol1osx23k2f5 ally>, Regan Heath says...
> Does the term "foreach" imply any direction forward or backward? To me it
> doesn't. I realise it's used in other languages, the same as in D, so it
> has a commonly understood meaning.
>
> I think the options are:
>
> - leave foreach, invent a backwards term i.e. foreach_r.
> - invent new terms, one for forward, one for backward.
> - add the ability to specify the 'step' in foreach
> Regan

I agree with Regan. foreach don't need to imply any direction. Compiler  
must be able to parallelize it. For iteration constructs with implied  
direction my favourite is:

foreach(forward)
foreach(reverse)
foreach(forward, firstEvenThenOdd)
etc

--
naryl



More information about the Digitalmars-d mailing list