On Sun, Oct 22, 2023 at 08:09:43PM +0200, Ralf Hemmecke wrote:
> On 22.10.23 18:08, Waldek Hebisch wrote:
> > > Additionally, I am not so happy with the explicit appearance of "->" when
> > > translating the Mapping type. I somehow think that -> should become a
> > > special treatment like zag or slash or ...
> > 
> > "->" is operator producing mapping types.
> 
> Yes, but that is not the operator in OuputForm.
> See "rarrow".
> 
> http://fricas.github.io/api/OutputForm.html#index-69
> 
> rarrow produces an OutputForm with operator TAG and two arguments and
> probably all formatters know how this has to be printed (at least I can
> confirm this for the FormatXXX types.
> 
> Can you change in Mapping_to_OutputForm(argl) the respective lines to
> 
>   ['TAG, nargs, rt]
> 
> (I haven't tested it.)
> 
> > The only objectionable thing is that some infix operators
> > appear in OutputForm as (op, arg1, arg2) and some other as
> > (arg1 op arg2).
> 
> Do you mean forms produced via infix(f,l)?
> But we have TAG and so do not need infix for ->.
> 
> Another thing...
> 
> Maybe your patch doesn't aim at providing also the following... but just in
> case...
> 
> %%% (6) -> (Tuple(Integer))::OF
> 
>    Cannot convert the value from type Tuple(Type) to OutputForm .

That is related but different thing.  In interperter types have
different representation than other values, so correctly handling
types as values requires special case code.  It seems that most
needed code is missing.  For example:

[Integer]

new(2, Integer)$PrimitiveArray(Type)

new(2, Integer)$Vector(Type)

[Integer, Float]::DirectProduct(2, Type)

(8) -> rr := [Integer, true]$Record(t : Type, b : Boolean)

   (8)  [t = NIL, b = true]
                                             Type: Record(t: Type,b: Boolean)
(9) -> rr.t

   (9)  Integer
                                                                   Type: Type

Type is invalid as argument to many constructors, but a lot of
constructors can by applied to it so users may expect that
printing of such things will do sensible things...

-- 
                              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/ZTWPuROoSW6fQ1y9%40fricas.org.

Reply via email to