Barton,
I think your %if is fine. I am just trying to learn about various versions of using "if" for piecewise() to output for
the purpose of deciding which is best for my application. I think I will stick to if instead of %if. As Stavros
suggested, if statements can be generated dynamically too. Changing %if is not necessary.
Rich
--------------------------------------------------
From: "Barton Willis" <willisb at unk.edu>
Sent: Sunday, December 27, 2009 7:58 PM
To: "Richard Fateman" <fateman at cs.berkeley.edu>
Cc: "Richard Hennessy" <rich.hennessy at verizon.net>; "Maxima List" <maxima at math.utexas.edu>
Subject: Re: [Maxima] How to prevent evaluation.
> The code for the simplifying %if is in
> share/contrib/to_poly_solve_extra.lisp,
> and user documentation is share/contrib/to-poly-user-doc.html.
>
> The function %if evolved to make the to_poly_solver work the way I
> wanted it to. My intention wasn't to write the ultimate simplifying
> conditional. I invite everybody to examine the code for %if and make
> it better. Of course, it would be great if better didn't break
> to_poly_solve :)
>
> Barton
>
> -----maxima-bounces at math.utexas.edu wrote: -----
>
>>To: Richard Hennessy <rich.hennessy at verizon.net>
>>From: Richard Fateman <fateman at cs.berkeley.edu>
>>Sent by: maxima-bounces at math.utexas.edu
>>Date: 12/27/2009 05:42PM
>>cc: Maxima List <maxima at math.utexas.edu>
>>Subject: Re: [Maxima] How to prevent evaluation.
>>
>>Richard Hennessy wrote:
>>>
>>>
>>> It seems like in the %if function both the then part and the else
>>> part are always expanded even when only one needs to be evaluated.
>>>
>>Maybe you could review what it is that %if does, and see if it is
>>consistent with the semantics of %if to evaluate only one part?
>>I expect that it is not. But I've forgotten how %if is supposed to work
>>and it isn't in the documentation I have.
>>
>>
>>> Is there a way to stop evaluation of both parts
>>>
>>
>>Certainly, but then it would be a different facility. Which do you
>>want? Also, Maxima generally is incapable of
>>avoiding a calculation because it might take too long. It can, of
>>course, stop a calculation after it has taken a while.
>>But not usually anticipating...
>>
>>_______________________________________________
>>Maxima mailing list
>>Maxima at math.utexas.edu
>>http://www.math.utexas.edu/mailman/listinfo/maxima
>
>