I have a suggestion.

Ary Manzana ary at esperanto.org.ar
Wed May 16 08:23:31 PDT 2007


I do like foreach_reverse. It's a very explicity name, and it doesn't 
appear often. And I guess an editor could provide a template for it, so 
just typing "fore" and pressing the down arrow will be enough.

Pragma escribió:
> 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.
> 



More information about the Digitalmars-d-announce mailing list