Hello,
Since I have two packages PA and PB with the same parameters and exports
that behave slightly differently, I would like to be able to pass them
to another constructor C to use them internally there. So I want the
respective packages be build/instantiated inside C (and maybe with
different parameters.
To simplify it a bit I came up with the following construction (attachment).
================
)abbrev domain RHSUP RHSparseUnivariatePolynomial
RHSparseUnivariatePolynomial(R : Ring): UnivariatePolynomialCategory(R)
== SparseUnivariatePolynomial(R) add
coerce(p : %) : OutputForm ==
h := p pretend SparseUnivariatePolynomial(R)
outputForm(h, "t"::Symbol::OutputForm)
)abbrev package RHX RHx
RHx(R: Ring, POL: R -> UnivariatePolynomialCategory R): with
var: () -> OutputForm
== add
mon ==> monomial $ POL(R)
var(): OutputForm == mon(1$R,1$NonNegativeInteger) :: OutputForm
================
Compilation of RHSUP is no problem, but RHx does not work:
initializing NRLIB RHX for RHx
compiling into NRLIB RHX
processing macro definition mon ==> Sel(POL R,monomial)
compiling exported var : () -> OutputForm
Internal Error
Error while instantiating type POLR
Well, maybe that is no surprise, because I haven't yet seen a
construction like
POL: R -> UnivariatePolynomialCategory R
in an argument. But what would be the way to go? Or does FriCAS simply
not allow that and I must think of something else?
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 fricas-devel+unsubscr...@googlegroups.com.
To view this discussion visit
https://groups.google.com/d/msgid/fricas-devel/01b0485e-018c-4648-9645-c5f5be4f602d%40hemmecke.org.
)abbrev domain RHSUP RHSparseUnivariatePolynomial
RHSparseUnivariatePolynomial(R : Ring): UnivariatePolynomialCategory(R)
== SparseUnivariatePolynomial(R) add
coerce(p : %) : OutputForm ==
h := p pretend SparseUnivariatePolynomial(R)
outputForm(h, "t"::Symbol::OutputForm)
)abbrev package RHX RHx
RHx(R: Ring, POL: R -> UnivariatePolynomialCategory R): with
var: () -> OutputForm
== add
mon ==> monomial $ POL(R)
var(): OutputForm == mon(1$R,1$NonNegativeInteger) :: OutputForm