Prining of types

1 view
Skip to first unread message

Waldek Hebisch

unread,
8:46 PM (2 hours ago) 8:46 PM
to fricas...@googlegroups.com
Our old code for printing types is rather complicated and works
differently than code doing coercion of types to OutputForm.

Attached is a patch which extended new code doing coercion of
types to InputForm and OutputForm to also produce string
(needed by the interpreter to print types). By default
this code uses Format1D to produce string representation
of values, but if you do:

)boot $use_old_value_print := true

it will use old code to produce string from OutputForm.

The reason for this switch is to allow easy comparison of the
two methods. Also, Format1D in some cases produces much
longer strings. The cases I observed are matrices, where
old code produces something like:

(5) -> i := e(1)$C


(5) e
1
Type: CliffordAlgebra(1,Fraction(Polynomial(Integer)),[[-1]])

while Format1D leads to:

(6) e
1
Type: CliffordAlgebra(1,Fraction(Polynomial(Integer)),matrix[[-1]])

Similar thing happens with subscripts, Format1D produces
'subscript(x, [1])' while old code just produces 'x[1]'. That
blows up types using scripted symbols.

Note that even if normally the code use Format1D, some cases are sent
to old code. And old code is called directly from some parts of the
interpreter. Still, is could be a step towards eventually
removing old code.

--
Waldek Hebisch
sum6a2.diff
Reply all
Reply to author
Forward
0 new messages