Maxima error when having strings in terms



On Sat, Mar 20, 2010 at 10:59:56AM -0500, Barton Willis wrote:
> -----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.
>

As explained in my other reply, we don't want to use strings as some kind of
variable names (I would also consider that as bad practice), but
we have these universal wrappers f(x,y,...), which basically wrap
lists of "things" (could be (combinatorial) graphs, lists, numbers, ...),
and a direct application of this existing framework would just plug in
a string as an argument.

The absurd thing is that one can't "shield" that string --- if it's somewhere 
in the term, then the whole thing falls down.

Oliver
 
> 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