On Wed, Oct 18, 2023 at 07:32:48PM +0800, Qian Yun wrote:
> 
> 
> On 10/18/23 08:05, Waldek Hebisch wrote:
> > Currently coercion of types to OutputForm is fake: it uses
> > an interpreter function to produce a string and this string
> > serves as OutputForm.  This is problematic because:
> > - resulting OutputForm has no structure
> 
> Is there a way to get such OutputForm object from interpreter?

Wehn testing I just looked at printed output from type-valued
expressions, like:

(1) -> Record(a : Integer, b : Boolean) 

   (1)  Record(a:Integer,b:Boolean)
                                                                   Type: Type

In principle, one should be able to get OutputForm like:

(2) -> POLY(INT)::OutputForm

   (2)  Polynomial(Integer())
                                                             Type: OutputForm

but currently this behaves in rather irregular way and AFAICS
does not use new code.
> 
> > 
> > ModularAlgebraicGcd(PrimitiveArray(U32Vector),Record(svz: Symbol,sm: 
> > U32Vecto
> > r,sp: Integer),ModularAlgebraicGcdTools2)
> > 
> > (that is single string which is broken between lines by output
> > formatter) we get:
> > 
> >     ModularAlgebraicGcd
> >        PrimitiveArray(U32Vector)
> >    ,
> >        Record(svz:Symbol,sm:U32Vector,sp:Integer)
> >    ,
> >        ModularAlgebraicGcdTools2
> > 
> > which is default handling of compound forms that are too big to fit on
> > a single line.
> 
> About this multi-line output, I wonder if there's a way to get one line
> string, so that it can be copy-pasted to recreate that type.
> (By using Format1D?)

Note that currently my patch deals only with output of types as
values.  Arguably we should use the same formatter for all
vales, so either 1D for everything or 2D for everything.

'printTypeAndTime' is separate and currently the patch does not
affect it.  And for 'printTypeAndTime' it is natural to use
one dimensional formatter.

-- 
                              Waldek Hebisch

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/ZS/q8etb0mELF9%2BF%40fricas.org.

Reply via email to