Subject: Maxima error when having strings in terms
From: Barton Willis
Date: Sat, 20 Mar 2010 10:59:56 -0500
-----maxima-bounces at math.utexas.edu wrote: -----
>(%i1)?is("x">0);
>Maxima?encountered?a?Lisp?error:
>?"x"?is?not?of?type?LIST.
You should, of course, report this as a bug. But I'm not sure that using a string
as a variable name is a good practice.
The function constp (defined in compar.lisp) is the cause of this Lisp error. For
a string input to constp, floatp, numberp, and symbolp all evalutate to false. After
that caar is called on the string. Maybe symbolp should be atom or $mapatom.
Also maybe (constp '$%i) should be true?
(defun constp (x)
(cond ((floatp x) 'float)
((numberp x) 'numer)
((symbolp x) (if (member x '($%pi $%e $%phi $%gamma) :test #'eq) 'symbol))
((eq (caar x) 'rat) 'numer)
...
--Barton