#16137: lazy_list from various input data
-------------------------------------+-------------------------------------
       Reporter:  MatthieuDien       |        Owner:
           Type:  enhancement        |       Status:  new
       Priority:  major              |    Milestone:  sage-6.4
      Component:  misc               |   Resolution:
       Keywords:  LazyPowerSeries,   |    Merged in:
  lazy_list, days57                  |    Reviewers:
        Authors:  Vincent            |  Work issues:
  Delecroix, Matthieu Dien           |       Commit:
Report Upstream:  N/A                |  530b21b1a97012b1adfc244dad57250922f4f46c
         Branch:                     |     Stopgaps:
  public/lazy_list_from_various_input_data|
   Dependencies:                     |
-------------------------------------+-------------------------------------

Comment (by mantepse):

 Hi there,

 I just checked that, in a very rudimentary way, we can define lazy lists
 recursively, as follows:
 {{{
 sage: from sage.misc.lazy_list import *
 sage: from itertools import *
 sage: l = lazy_list_recursive(cache = [[]])
 sage: l.define(imap(lambda a: [1] + a, l))
 sage: l[0], l[1], l[2]
 ([], [1], [1, 1])
 }}}

 I also had to realise that `itertools.product` is not particularly
 intelligent what concerns infinite streams...

 I'll take a break now and wait for feedback.  In summary, it now seems to
 me that we want `lazy_list`
 to be

 * a model for "infinite lists", i.e., support slicing
 * play as well as possible with iterators
 * provide functionality that `itertools` cannot provide:
     * `next` depending on the previous values
     * possibly recursive definitions
     * what else?
 * what else?

 In particular, should `lazy_list` additionally provide wrappers for the
 functionality in `itertools`?  Currently, I don't think so.

--
Ticket URL: <http://trac.sagemath.org/ticket/16137#comment:44>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to