On 02/10/2015 01:14 AM, Waldek Hebisch wrote:
> (3) -> st: Stream K := repeating([1,2,3])
>>
>>          _____
>>    (3)  [1,2,3]

> AFAICS series is fine, the problem is with printing: by default
> coercion to OutputForm tries to print all known coefficients of
> the series.

Hmm. Strange. I came to the same conclusion that printing must be the
problem, but then why didn't I run into the same problem with

  st: Stream K := repeating([1])

The stopping criteria here...

https://github.com/fricas/fricas/blob/master/src/algebra/pscat.spad#L291

  for n in (count + 1).. while explicitEntries? uu and _
         not eq?(uu, rst uu) repeat

obviously only tests for cycles of length 1.

First of all, doesn't the default

  showAll?() == true

look a bit dangerous? In fact, the problem with my example wouldn't have
been there if showAll?() would be false.

> We probably should change this default, to
> only show fixed number of coefficients.

The variable _$streamCount$Lisp is 10 in my case. So that would actually
be fine.

There is also a variable _$streamsShowAll$Lisp. Which is false by
default (comes from ")set streams showall off"). I would have expected
that infinite series respect this variable. But that's seemingly not the
case.

My suggestion would be to have at least

      showAll?() ==
        NULL(_$streamsShowAll$Lisp)$Lisp => false
        true

defined everywhere instead of simply setting it to true.
(Actually, there should be a proper interface. I wouldn't want to see
"$Lisp".)

But even then the user must be warned when dealing with cyclic streams.
I've no idea how this should be done, but letting the user blindly run
into exausted memory isn't the best idea.

Ralf

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" 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/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to