I don't have an answer. The ("*"()) junk looks like
multiplication applied to no arguments. Maxima
does apply("*",[]) --> 1; maybe your code
needs another evaluation.
Did you consider something like (wxmaxima copy text)
(%i12) facsum(a * kg + b * m / s + c * kg + 59 * m / s ,m / s,kg);
(%o12) ((c+a)*kg*s+(b+59)*m)/s
(%i13) multthru(%);
(%o13) ((b+59)*m)/s+(c+a)*kg
(%i14) facsum(a * kg + b * m + c * kg + 59 * gpf ,kg,m, gpf);
(%o14) b*m+(c+a)*kg+59*gpf
(%i15) multthru(%);
(%o15) b*m+(c+a)*kg+59*gpf
Barton
-----maxima-admin@math.utexas.edu wrote: -----
>To: Maxima list
>From: C Y
>Sent by: maxima-admin@math.utexas.edu
>Date: 05/19/2005 12:01AM
>Subject: Gah... What am I doing wrong
>here?
>
>After repeated failed attempts to group common
>unit terms over the
>addition operator in lisp, I finally decided to
>see if I could make
>Maxima do it. My first cut at it is below. The
>idea is to take
>advantage of the unit packages mtimes formatting,
>and it works OK up
>until the end when the display gets hashed. Can
>somebody tell me what
>I'm doing wrong?