#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 MatthieuDien):

 Therefore, the answer of Martin :

 > @Martin
 > The diference bewteen lazy_list and iterator is not only the caching.
 > There is also the way to compute an element : if you want the nth
 > element of an iterator you have to compute the (n-1) previous ones,
 > for lazy_list (currently the implementation does not do this but it
 > should in close future) the goal is to compute elements only if it
 > obligatory.

 > For example, you don't want to compute all the coeffcients of a serie
 > if at the end, you will only use the odd (or even) part.

 Excellent point!

 You made me think again about the name - I don't particularly like
 "lazy_list".  Of course, from a math point of view I'd call it
 "Sequence".  However, I just discovered that this is already taken in
 Sage for something related, although not identical.

 I then discovered "Family", which seems the same but a bit more general.
 In fact, "lazy_list" is a Family having index set natural numbers.

 Shouldn't we merge these two concepts, at least in the long run?

 > Concerning recursive definition, we have to allow it but the
 > implementation must not be recursive because recursion is extremly
 > expensive in Python.

 I'm not quite sure what you mean.  There is hardly any implementation.
 I want that definitions like s = f(s), where "s" is a "lazy list"
 determined by this equation, can be easily typed into sage.

 Thus, I think of it as a convenience feature, for rapid prototyping.
 Its usefulness lies in the fact that it's very general.  Thus, from the
 user's perspective, I wouldn't expect it to do any fancy term-rewriting.

 > And finally, to answer to Martin about "what is `_normalize_slice` ?
 > ", `_normalize_slice` means nothing it is just a piece of code that I
 > wanted to factorize. In fact I should factorize directly `__getitem__
 > ` by adding a method which have to create a slice (last line of code
 > `__getitem__`).

 OK, thanks!

 Best,

 Martin

--
Ticket URL: <http://trac.sagemath.org/ticket/16137#comment:46>
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