Fix bug #2876: Error simplifying infix operators declared l/rassociative
commit00180b3256a89c060bad427bc229901286581510
authorKris Katterjohn <katterjohn@gmail.com>
Sat, 13 Nov 2021 20:18:19 +0000 (13 15:18 -0500)
committerKris Katterjohn <katterjohn@gmail.com>
Sat, 13 Nov 2021 20:18:19 +0000 (13 15:18 -0500)
tree0ada58e66c7bbf020e05a0ea1f7709038f312d9f
parent20dfc23d386a73ad1666bd1dbac5b8cb91fcf460
Fix bug #2876: Error simplifying infix operators declared l/rassociative

This is an ancient bug that was present in Macsyma.

Infix operators are assumed to be binary.  In SIMPARGS there has been
a two-arg check for expressions with an infix operator, including
operators that have been declared lassociative or rassociative:

(%i1) infix ("++")$

(%i2) declare ("++", lassociative)$

(%i3) a ++ b ++ c;

++: expected exactly 2 arguments but got 3: [a, b, c]
 -- an error. To debug this try: debugmode(true);

Now the two-arg check is omitted for infix operators with a declared
associativity.  Applying such an operator to less than two args or
more than two args is no longer an error.

No problems with the test suite or share test suite.  New tests have
been added to rtest11.
src/simp.lisp
tests/rtest11.mac