Hi Waldek,
I know that the compiler does not let me have an exported and a local
function of the same name, but that I cannot have local functions with
the same name but different parameter list is new to me and somewhat
unexpected.
I get
)compile qft.spad
; caught WARNING:
; Duplicate definition for |QFUNTOOL;streamAux!0| found in one file.
; See also:
; The ANSI Standard, Section 3.2.2.3
;
; compilation unit finished
; caught 2 WARNING conditions
although the compilation seemingly went through without an error message.
Although I don't have a small example for demonstration, with the above
code, my program ran into something like.
>> System error:
invalid number of arguments: 4
which went away after renaming one of the streamAux functions.
Unfortunately, I'm not completely sure that this is the reason for the
above System error, so I actually only have the question whether despite
the above warning about
; Duplicate definition for |QFUNTOOL;streamAux!0| found in one file.
FriCAS deals well with such kind of local function definitions.
Thanks in advance.
Ralf
PS: It would also be helpful to learn how I can debug such a System
error. In connection with infinite series, it looks a bit difficult to me.
--
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 https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.
)abbrev package QFUNTOOL QFunctionTools
Z ==> Integer
++ QFunctionTools allows to create a series from another series.
QFunctionTools(C: Ring, L: UnivariateLaurentSeriesCategory C): with
choose: (Z -> Z, L, Z) -> L
++ choose(f, x, n0) returns the power series z whose
++ n-th coefficient is the f(n)-th coefficient of x, i.e.,
++ coefficient(z, n) = coefficient(x, f n) for all n>=n0.
++ Start with n=n0, i.e., the order of the result will be n0.
++ choose(f, x, n0) = choose(c+->c, f, x, n0)
choose: (C -> C, Z -> Z, L, Z) -> L
++ chooseMap(g, f, x, n0) returns the power series z whose
++ n-th coefficient is the f(n)-th coefficient of x after application
++ of g, i.e.,
++ coefficient(z, n) = g(coefficient(x, f n)) for all n>=n0.
++ Start with n=n0, i.e., the order of the result will be n0.
== add
streamAux(f: Z -> Z, x: L, n: Z): Stream C == delay
cons(coefficient(x, f n), streamAux(f, x, n+1))
choose(f: Z -> Z, x: L, n0: Z): L == laurent(n0, streamAux(f, x, n0))
streamAux(g: C -> C, f: Z -> Z, x: L, n: Z): Stream C == delay
cons(g coefficient(x, f n), streamAux(g, f, x, n+1))
choose(g: C -> C, f: Z -> Z, x: L, n0: Z): L ==
laurent(n0, streamAux(g, f, x, n0))