orderlessp([rat(a)],b) bug



The orderlessp function often halts with a (non-descriptive) error message 
if
one or more of its arguments are lists or matrices  containing CRE 
expressions. 
The Maxima  documentation for orderlessp doesn't mention this limitation.

If you need to order expressions that might involve lists or matrices 
containing 
CRE expressions, apply totaldisrep to each argument of the ordering 
predicate. 
Here's an example

Maxima 5.5 Tue Dec 5 16:55:33 2000 (with enhancements by W. Schelter).
Licensed under the GNU Public License (see file COPYING)

(C4) xorderlessp(x,y) := orderlessp(totaldisrep(x), totaldisrep(y));
(D4) xorderlessp(x, y) := ORDERLESSP(TOTALDISREP(x), TOTALDISREP(y))

/*   xorderlessp works okay on lists with CRE elements */

(C5) xorderlessp([rat(x)],[rat(x)]);
(D5)                             FALSE
(C6) orderlessp([rat(x)], [rat(x)]);

Error: 1 is not of type LIST.
Fast links are on: do (si::use-fast-links nil) for debugging
Error signalled by MACSYMA-TOP-LEVEL.
Broken at MACSYMA-TOP-LEVEL.  Type :H for Help.
MAXIMA>>


With CRE arguments, Maxima treats lists and matrices (anything else?) 
differently than it treats other functions with CRE arguments.
Consider

(C1) cos(rat(a));
(D1)                            COS(a)
(C2) f(rat(a));
(D2)                             f(a)

(C3) [rat(a)];
(D3)/R/                           [a]

(C4) ratp(%);
(D4)                             FALSE

(C5) [a,rat(b)];
(D5)/R/                         [a, b]
(C6) ratp(%);
(D6)                             FALSE
(C7) 
 
Thanks to everybody that helped with this discussion. 

Barton