Martin Baker wrote:
> 
> Please could you add this formatter to the next release:
> 
> https://github.com/martinbaker/multivector/blob/master/monospace.spad.pamphlet
> 
> The documentation is here:
> 
> http://www.euclideanspace.com/maths/standards/program/mycode/output/monospace/
> 
> (this contains diagrams that I can't put in the pamphlet)
> 
> Its just an optional output formatter with the same structure as the 
> other formatters. This is designed to output to a monospace device such 
> as the command line console.

Martin, have you tried to run 'src/input/of.input' trough
your formater?  When I tried I see a lot of errors.
Sorry for waiting long, but I wanted to have time for
serious tests.  Unfortunatly, ATM it is failing the
first test -- 'of.input' contains several constructs,
but only simplest examples of each construct.

> The aim of this is to use as the template for more specialist monospace 
> formatters. It would really help me develop this if you could put it in 
> the next release.

Well, the tree walkinig part certainly should _not_ be used
as template for other formaters.  You use string matching
and ad hoc trick, which lead to errors.  Other formaters
(except for Html) were converted to match symbols, that
avoids many problems.  Also, decision to put (or not)
parenthesis around a construct should be based on priorities.
The formater responsible for given construct knows
priority of operator (construct) it handles and
is given priority of operator at higher level, so
it has all information needed to make decision about
parenthesis.  Trying to do it in other place, like
you do in 'formatBinary' leads to unnecesary complications.
Comparte your formater with TeX of MathML, the logic
to insert parenthesis is much simpler in both of them
(and both use almost the same logic for this).

Concerning 2D formatting it looks that in your formater
simple matrices work OK, but subscripts/superscripts
nested in other constructs cause trouble.

For example:

(exp(x^2/3) + log(1/(x+1)))^10


has problem (this may be because it needs to be split
between lines).


-- 
                              Waldek Hebisch
[email protected] 

-- 
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to