Ranges, constantly frustrating

Regan Heath regan at netmail.co.nz
Fri Feb 14 09:05:10 PST 2014


On Fri, 14 Feb 2014 13:14:51 -0000, bearophile <bearophileHUGS at lycos.com>  
wrote:

> Regan Heath:
>
>> FWIW I disagree.  I think it's immediately and intuitively obvious what  
>> 'i' should be when you're foreaching over X items taken from another  
>> range, even if you do not know take returns another range.  Compare it  
>> to calling a function on a range and foreaching on the result, you  
>> would intuitively and immediately expect 'i' to relate to the result,  
>> not the input.
>
> Using enumerate has several advantages.

In my case I didn't need any of these.  Simple things should be simple and  
intuitive to write.  Yes, we want enumerate *as well* especially for the  
more complex cases but we also want the basics to be simple, intuitive and  
easy.

That's all I'm saying here.  This seems to me to be very low hanging fruit.

R

-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/


More information about the Digitalmars-d-learn mailing list