I would like the following function to return a function that I can feed
into a stream: () -> R -> Stream R function and whose resulting stream
is supposed to be fed into a series function to generate a Laurent series.
qPochhammerCoefficients(a: P, q: P): () -> R == (): R +->
n: N := 0
p: P := 1 - a
m: P := 1
d: N := degree a
degb: N := degree q
qCoefficient(): R ==
k := n
dbgPrint("xk=", k)
n := n+1
k < d => [k, coefficient(p, k)]$R
m := m*q
d := d+degb
p := p*(1-m)
[k, coefficient(p, k)]
qCoefficient
Compiles fine in the respective package context. The only problem is, it
doesn't work.
When I call it, it leads to
...
[xk=,NIL]
>> System error:
Argument X is not a NUMBER: NIL
Well, OK, there is a problem with the n not being recognized as the
variable n from outside the qCoefficient function.
In Aldor I would anyway have to declare
qCoefficient(): R ==
free n;
...
But what is the corresponding declaration in SPAD?
Is there any other way to get the value of the outside variables.
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.