I have tried the following code.
S ==> UnivariateLaurentSeries(Fraction Integer, 'x, 0)
sx := x :: S
s := (sx^3-7*sx)/(3*sx^7-sx^4)
terms s
TERMS n == [r for r in terms(s) while r.k < n]
ll := TERMS 4
entries ll
entries TERMS 4
Interestingly the last three evaluations show as:
(6) -> ll := TERMS 4
Compiling function TERMS with type PositiveInteger -> Stream(Record(
k: Integer,c: Fraction(Integer)))
(6)
[[k = - 3, c = 7], [k = - 1, c = - 1], [k = 0, c = 21], [k = 2, c = - 3],
[k = 3, c = 63]]
Type: Stream(Record(k: Integer,c:
Fraction(Integer)))
(7) -> entries ll
(7)
[[k = - 3, c = 7], [k = - 1, c = - 1], [k = 0, c = 21], [k = 2, c = - 3],
[k = 3, c = 63]]
Type: List(Record(k: Integer,c:
Fraction(Integer)))
(8) -> entries TERMS 4
>> Error detected within library code:
infinite stream
I am not afraid of the actual error, because in general that must be
expected, but storing a value in a variable seems to make a difference
for the interpreter. I'm not sure that an ordinary user likes or
understands this.
In fact, I don't understand why the "entries" function would get another
argument value if called this or that way. What is happening here?
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 view this discussion on the web visit
https://groups.google.com/d/msgid/fricas-devel/0f798954-49fc-eb1b-6e39-5170bb815fde%40hemmecke.org.