On Tue, Apr 14, 2026 at 02:34:11AM -0700, 'Martin R' via FriCAS - computer algebra system wrote:
> Thank you! Apparently `unparse$InputForm` works in *very* simple cases.
> It does not work in the case of arguments which are lists (as in
> MultivariatePolynomial) and when arguments are strings (as in Union(T,
> "failed")). It also has a minor problem with constructors that do not take
> arguments.
>
> (I guess that `unparse` is intended for objects)
Hmm, I get:
(1) -> t := MultivariatePolynomial([x, y], INT)
(1) MultivariatePolynomial([x, y],Integer)
Type: Type
(2) -> t::InputForm
(2) (MultivariatePolynomial (construct x y) (Integer))
Type: InputForm
(3) -> unparse(t::InputForm)
(3) "MultivariatePolynomial([x,y],Integer())"
which looks correct.
If you mean that what 'dom' produces does not work as argument
to 'unparse', that is right: 'dom' contains bare values.
My idea was to use 'typeToForm' from i-coerce.boot, like
typeToForm(dom(1$t), ["InputForm"::Symbol])$Lisp
(where 't' is is above) to get input form. AFAICS this will do
exactly what coercion of a type to InputForm would do, but
starting from result obtained form 'dom'.
> NB: it's not a major problem for me.
There is no need to unparse if the goal is to evaluate. Valid
InputForm can be passed to 'processInteractive'. Actually,
when you have a string, usual idiom is to parse first and
then call 'processInteractive' to evaluate.
> --
> 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...@googlegroups.com.
> To view this discussion visit
https://groups.google.com/d/msgid/fricas-devel/21daaba2-2d92-40d0-9cbe-b5783fc85085n%40googlegroups.com.
--
Waldek Hebisch