suggestion: remove mbox from maxima; minor bug revealed.



Why?  You probably never used box(), but it is something that is checked for
repeatedly anytime anything is simplified.  Both mbox and mlabox.
mlabox is a labelled  (or labeled)  box. 
 The operator mbox appears to be indistinguishable from mlabox with an empty
label "".
So the suggestion is to remove the operator mbox and always use mlabox.


To try these things out, and see what box does, type

box(a+b+c)^(d+e);

or 

box (a+b+c,L)^(d+e);

or 
box (a+b+c,"")^(d+e);

Every place box of one argument is used, it can be translated to box(..,"").

Why did this suggestion come up? 


One benefit is that two lines in the simplifier, function great

	((memq (caar x) '(mbox mlabox)) (great (cadr x) y))
	((memq (caar y) '(mbox mlabox)) (great x (cadr y)))

can be changed to the presumably much faster

	((eq (caar x) 'mlabox) (great (cadr x) y))
	((eq (caar y) 'mlabox) (great x (cadr y))).

Such "micro-optimizations" are rarely worth it, but this is a cleaner
conceptual result, too.


While checking this out, there is a bug, in that 

box(aaaa,lab1)+box(aaaa,lab2);

and 
box(aaaa,lab2)+box(aaaa,lab1); 

return different "simplified" expressions.

adding them together leaves pieces uncombined.

The lines in the function great  work well if an expression contains only
ONE box subexpression, although the intended design was clearly to allow any
number of boxes.  It also doesn't cause any problems if no two boxes have
the same "contents".
...
RJF