On Tue, Nov 08, 2016 at 10:35:07AM +0000, Ed Avis wrote: > Dave Mitchell wrote: > > >For ranges, e.g. (1..10) and ('a'..'z'), it only records the current value and the last value. > > But for numeric ranges, if you know the current value it is just a subtraction to find its index. No, at the point where you have iterated 'for (11..20) {}' say, 7 times, exactly two values are currently stored: 17 and 20. There is no way (in general) to deduce that value '7' from that. Extra bookkeeping of one form or another would need to be added. -- A walk of a thousand miles begins with a single step... then continues for another 1,999,999 or so.Thread Previous | Thread Next