David Green <[EMAIL PROTECTED]> wrote:
> Aren't lazy lists a funny kind of iterator?  Ones that memoise their
> results.  And supply an indexing method [].

As I mentioned the other day, I fail to see any material difference
between an iterator and a lazy list, except that a few operations are
allowed on a lazy list that aren't on an iterator.  (And all of those
could be emulated, albeit inefficiently, with one; even with a pipe,
if the user does $pipe[1024], there's no technical reason you can't
store the first thousand-odd lines and return the one they asked for.)

Also note that there's no difference between iterating over a lazy
copy of an array, and iterating over a lazy copy of a lazy copy of an
array, except for the amount of indirection; thus, there would be no
need for for() to distinguish between C<for $array> and C<for $iter>
(though both of those forms might need a splat).

-- 
Brent 'Dax' Royal-Gordon <[EMAIL PROTECTED]>
Perl and Parrot hacker

"I might be an idiot, but not a stupid one."
    --c.l.p.misc (name omitted to protect the foolish)

Reply via email to