Defining new operator syntax and printing correctly
Subject: Defining new operator syntax and printing correctly
From: Robert Dodier
Date: Wed, 9 Apr 2008 20:29:35 -0600
On 4/9/08, Stavros Macrakis <macrakis at alum.mit.edu> wrote:
> infix("%%", 15, 15)$
> However, on printout, Maxima inserts unnecessary parentheses:
>
> foo => [b + a %% c or q, (d %% e)]
Stavros, the 2-d display code constructs an expression in which
the commas are represented by the operator MCOMMA,
which has binding power 20, so parentheses are thrown in
to override the operator precedence.
However the parser looks at $\, which has binding power 10.
Probably the binding power of $\, and MCOMMA should be
made the same --- let's say 10 so expressions continue to
parse as before. I'll change the binding power of MCOMMA
if it's OK with you.
1-d output doesn't worry about MCOMMA --- I see this:
grind (foo);
=> [b+a %% c or q,d %% e]$
HTH
Robert Dodier