Version 2 of iterators

Updated 2002-08-27 12:08:54

CLU's iterators correspond to what Python and other languages call generators. CLU iterators were modeled on Alphard's generators [L1 ].

IPL-v generators and Lisp mapping functions are related to Alphard's generators.

Can someone explain the idea of iterator/generator here?

It seems to me that the idea is that rather than explicitly listing an entire range of values (that a variable can take within a loop, etc.) one lists the beginning and ending value of a range plus the incremental factor and the language generates the value as needed. How is this different than using a for loop though?