On Thu, Aug 27, 2009 at 5:33 PM, Richard Fateman <fateman at cs.berkeley.edu>wrote:
> > ...Function naming is cryptic and there's no documentation
> > available (for old code). I for instance don't know what add* vs add2
> > does - and would have to spend some amount of time inspecting the
> > source code to understand.
> neither do I, and it wouldn't surprise me if they were written by
> different people and did exactly the same thing.
>
I wrote both add* and add2 about 35 years ago. They were (and are)
documented in the comment at the top of opers (and mopers):
;; The basic functions in the virtual interface are ADD, SUB, MUL, DIV, POWER,
;; NCMUL, NCPOWER, NEG, INV. Each of these functions assume that their
;; arguments are simplified. Some functions will have a "*" adjoined to the
;; end of the name (as in ADD*). These do not assume that their arguments are
;; simplified. In addition, there are a few entrypoints such as ADDN, MULN
;; which take a list of terms as a first argument, and a simplification flag as
;; the second argument. The above functions are the only entrypoints to this
;; package.
;; The functions ADD2, ADD2*, MUL2, MUL2*, and MUL3 are for use internal to
;; this package and should not be called externally. Note that MOPERS is
;; needed to compile this file.
The bottom line is: unless you have some very special reason, you should not
be using xxx2 and xxx*, but only xxx and xxxN. The m+ series macroexpands
to add* etc. and should not be used in normal code (where intermediate
subexpressions are always assumed to be simplified). I wish I could have
used the names m+ etc. for the assume-simplified version, but the names were
already in use when I wrote opers.
-s