suggestion: remove mbox from maxima; minor bug revealed.



On 8/8/06, Richard Fateman <fateman at cs.berkeley.edu> wrote:
>
> 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.


Sounds reasonable.

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.
>

"much faster"?  Not with a half-decent compiler, which translates short
memq's to multiple eq's.  On the PDP-10 compiler, (memq ... '(a b)) took
only two more machine instructions than (eq ... 'a).  But then, maybe modern
compilers aren't as good.

But I buy the conceptual simplicity argument.

         -s