Bug in rest() function?



laurent couraud wrote:

> Hi
> 
> (%i1) rest(x^2);
> Wrong number of arguments to "^"
>  -- an error.  Quitting.  To debug this try DEBUGMODE(TRUE);
> (%i2)
> 
> _______________________________________________
> Maxima mailing list
> Maxima@www.math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima



The message can be explained by observing that the internal
form of x^2  is [simplifying it somewhat...]   the lisp
list  (^ x 2).

the way the macsyma REST function works, it produces the
list  (^ 2)     which is then simplified. The simplifier
notices the invalid form and this prompts the error message.

If you want to extract 2, try part(%,2).

What would you like REST to do in this case?


RJF