conditionals and bad plist




> -----Original Message-----
> From: maxima-bounces at math.utexas.edu [mailto:maxima-
> bounces at math.utexas.edu] On Behalf Of Stavros Macrakis
> Sent: Tuesday, January 09, 2007 8:49 AM
> To: Barton Willis
> Cc: maxima at math.utexas.edu
> Subject: Re: [Maxima] conditionals and bad plist
> 
> > (%i1) prederror : false$
> > OK more or less:
> > (%i2) if f(k) then 0 else %pi;
> > (%o2) if unknown then 0 else %pi
> 
> No, this is worse than useless 

Good point. Commercial macsyma leaves it alone.

> 
> > But not OK:
> > (%i3) if f(k) + 1 then 0 else %pi;
> > Incorrect syntax: Found algebraic expression where logical expression
> > expected
> 
> This is as designed.  The protasis must be a boolean expression.  "+"
> cannot return a boolean result, so the syntax prevents this.

Protasis!!  A new word for my day!!

>