conditionals and bad plist




> -----Original Message-----
> From: maxima-bounces at math.utexas.edu [mailto:maxima-
> bounces at math.utexas.edu] On Behalf Of Barton Willis
> Sent: Tuesday, January 09, 2007 6:14 AM
> To: maxima at math.utexas.edu
> Subject: conditionals and bad plist
> 
> While we are on the topic of 'case' vs 'if then else',
> consider this bug (or these bugs):
> 
> (%i1) prederror : false$
> 
> OK more or less:
> 
> (%i2) if f(k) then 0 else %pi;
> (%o2) if unknown then 0 else %pi
> 
> But not OK:
> 
> (%i3) if f(k) + 1 then 0 else %pi;
> Incorrect syntax: Found algebraic expression where logical expression
> expected
> 
> I see no reason for the syntax error. 

It is an error of some sort to expect xxx+1  to return true or false.
The program's objection seems to me to be valid in a type-checking sense.
Whether this is a syntax error or some other kind of error may be arguable.


Definitely not OK:
> 
> (%i3) if (f(k) + 1) then 0 else %pi;
> Maxima encountered a Lisp error:
>  Error in PROGN [or a callee]: Bad plist ($K)
> 

This error message is not helpful.  The commercial macsyma objects to this
as well, but the message is "error: circular plist".  This presumably has to
do with the violence done to expressions by mevalp and its related programs
that deal with assumptions.

RJF