I have a suggestion.

Pragma ericanderton at yahoo.removeme.com
Wed May 16 08:18:22 PDT 2007


freeagle wrote:
> YonggangLuo wrote:
>> i think it's will be a good idea to replace "foreach_reverse" with  
>> "frr".
>> "foreach_reverse" is too long as a keyword
> 
> I find "frr" very cryptic.
> 
> consider this:
> 
> if(reverse)
> {
>     frr(int i, array)
>     {
>         ...
>     }
> }
> else
> {
>     foreach(int i, array)
>     {
>         ...
>     }
> }
> 
> Those keywords doesn't seem related, but would in fact provide similar 
> funcitonality.
> 
> I too would like to see this "foreach_reverse" solved in other way, but 
> not with another keyword
> 
> freeagle

I agree with you completely.  While I understand the goal behind "foreach_reverse" is to put optimal 
array-traversal-loop generation in the hands of the compiler (read: faster than opApply), the keyword itself remains the 
only real wart.  The keyword "rforeach" would have made a much better candidate IMO.

-- 
- EricAnderton at yahoo



More information about the Digitalmars-d-announce mailing list