On 2012-09-01, Stavros Macrakis <macrakis at alum.mit.edu> wrote:
> I think if you look back at the mail archives, several of us were concerned
> about conflating the simplifying and the programming 'if'. Robert went
> through with the change nonetheless,
Um, the stuff I wrote simplification of "if" and Boolean expressions is
in share (share/contrib/boolsimp).
I did make some changes to the evaluation of Boolean expressions,
specifically that Boolean expressions evaluate to Boolean expressions
when prederror = false and the result is neither true nor false.
(Previously in that case a Boolean expression evaluated to 'unknown.)
As a side effect, that made partial evaluation of "if" expressions much
more interesting and useful.
> This is perhaps because people aren't writing imperative code in Maxima, or
> if they are, they are avoiding the noun case. That is, they simply aren't
> writing things like
>
> if x<0 then i:1 else i:2
> and
> if x<0 then go(label)
>
> where the truth of x<0 is unknown at runtime. I admit this makes me a bit
> nervous, but Maxima has always been pretty pragmatic and permissive about
> things like this.
I agree that such constructs are uncommon, but be that as it may, as
long as the user can easily predict the behavior of "if", whatever
result they get is their own problem.
best
Robert Dodier