A "Lazy" list, as described for Perl 6, is a way of not doing the work to find that list element's value unless (until) it is needed. Often times a list can be compactly represented as an iterator. Perl 5 has some special cases for efficiency, but in Perl 6 the concept of "Lazy lists" is general.
My brainstorm is that a "Lazy list" is just a "work list" of pending tasks that may need to get done. Meanwhile, hyperoperators apply an operator to a list, but assume that it is side-effect free so it can do them in parallel implicitly. But, the iterator and the hyperoperator are just two extremes of a continuum of guarantees and flexibility of how a "work list" can be processed.
It's been touted that hyperoperators are an example of making threading available as a deeper part of the language, not requiring explicit low-level thread operations to acheive. I think that the Lazy list is likewise, but in fact serves as a better exemplar of how to use it for background activities because you can put general and arbitrary work in your work list.
My essay is posted here. I invite feedback to improve the article, as well as general discussion of the idea.
—John
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.