ratnumer feature



Described below is an annoying (my opinion) feature of ratnumer.
Consider:

/* The ratnumer function doesn't automatically map over lists */

(C1) q : ratnumer([1/x + 1/y,x]);
(D1) [1/y+1/x,x]

/* I can live with this; however, ratp(q) evaluates to true, yet
the members of q aren't in CRE form. */

(C2) ratp(q);
(D2) TRUE
(C3) map(ratp,q);
(D3) [FALSE,FALSE]

/* Worse yet, listp(q) evaluates to false.  */

(C4) listp(q);
(D4) FALSE
(C5) q;
(D5) [1/y+1/x,x]
(C6) ?print(q);
((MRAT SIMP
       (((MLIST SIMP)
         ((MPLUS SIMP) ((MEXPT SIMP) |$x| -1) ((MEXPT SIMP) |$y| -1))
         |$x|))
       (#:|x1101| #:|[1/y+1/x,x]1100|))
 (#:|x1101| 1 1) . 1)

I got the same results using commercial macsyma (version 2.2 and 422).

Lesson: don't apply ratnumer to a Maxima list.


Barton