partially-evaluated Boolean expression stuff committed



 unfortunately, the result that you expect is potentially nonsense.

Consider f(x):=block([],local(y), assume(y>0), if x<3 then x^2 else y)$

You have lost the context of y.  And also the context of x.  In the returned
expression the x and y are potentially different, and the expression may not
be at all equivalent.

Good luck.
RJF

> -----Original Message-----
> From: maxima-bounces at math.utexas.edu 
> [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Jaime E. Villate
> Sent: Monday, April 02, 2007 3:08 PM
> To: Robert Dodier
> Cc: Maxima
> Subject: Re: [Maxima] partially-evaluated Boolean expression 
> stuff committed
> 
> On Sun, 2007-04-01 at 18:02 -0600, Robert Dodier wrote:
> > I've committed changes to the code for Boolean expressions per
> > discussion here recently. Changes to the code for conditional
> > expressions (i.e. if--then--else) were not committed.
> > Hope this helps,
> Yes, it does help me. Thanks. I can now do things like:
>   (%i1) f(x):=if x<3 then x^2 else y$
>   (%i2) f(x);
>   (%o2) if x<3 then x^2 else y
> It means that my programs now accept functions like that as input.
> However, the program needs to extract the list of variables of the
> function, but when I use listofvars, the result is wrong:
>   (%i3) listofvars(f(x));
>   (%o3) [x,true,y]
> Any ideas on how to get around that problem?
> I could use delete(true,%o3), but that seems like a hack that might
> lead me into further problems.
> Cheers,
> Jaime
> 
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>