develooper Front page | perl.perl6.language | Postings from November 2008

Re: Iterators and Laziness

Thread Previous
From:
Daniel Ruoso
Date:
November 28, 2008 10:15
Subject:
Re: Iterators and Laziness
Message ID:
1227896033.10254.58.camel@pitombeira
Sex, 2008-11-28 às 14:23 -0300, Daniel Ruoso escreveu:
> > You write:  my $item = =$foo;
> > Does that get one item from the iterator object?
> It depends on the iterator in question, but it certainly gets something
> (unless the iterator is over, of course), I'm thinking on the following:

I thought it would be helpful to have a complete implementation of how
an Iterator would work, in this case the proposed implementation for the
map operator in mildew (yes, the amount of indirection in SMOP kinda
requires us to write it in a high-level-language):

That code doesn't use any of the implied lazyness/eagerness of any
operator, it uses the API directly, much of the effort in that code is
going to be simplified to the user by the use of the feed operator...

The code is in the pugs repo:
http://svn.pugscode.org/pugs/v6/mildew/Map.pm


daniel


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About