On Thu, Aug 05, 2021 at 05:39:36AM +0000, Neven Sajko wrote:
> Hello,
>
> I want a Spad function parameterized by some constants, but this
> function would preferably reside in a package without constructor
> parameters.
>
> For example like this:
>
> I ==> Integer
> UPLY(var) ==> UnivariatePolynomial(var, Expression(I))
> TAY(var) ==> UnivariateTaylorSeries(Expression(I), var, 0)
> ...
> polynomial9(s: TAY(X)): UPLY(X) == univariatePolynomial(s, 9)
>
> The above function polynomial9 should be parameterized by X (the name
> of the variable, of type Symbol).
>
> How best to achieve this in Fricas Spad? Do I have to create a new
> package just for this function?
In Spad you need extra package with all needed parameters. In
"interpreter" there is a difference: intepreters compiles functions
on demend, so from one source interpreter can produce versions
for multiple types. However, interpreter has its own limitations.
> In case there is a way to have one parameter, is it also possible to
> have multiple parameters?
Interpreter has "modes", that is types with one free parameter,
but they are probably irrelevant to your problem.
--
Waldek Hebisch