If then else and unevaluated conditionals



On 1/29/07, Michel Van den Bergh <michel.vandenbergh at uhasselt.be> wrote:

> I am sort of wondering there should not be two different if then else's.
> One which is a programming construct and which is handled by meval,
> and one which it a  "mathematical concept" and which is handled by
> the simplifier. Unevaluated conditionals should go into the latter and
> not into the former I would say.

It appears that only distinction you make here is that one form of if
is evaluated and one is simplified. This is already the case in the
boolsimp code -- if (the verb form) is evaluated & simplified
and 'if (the noun form) is simplified. This treatment is analogous to
other operators for which there exist noun & verb forms.

If you mean something else, then sorry for the misunderstanding.
You'll have to clarify.

> The mathematical if then else could simpy be if(expr1,expr2,expr3).

There is only one syntax for integrate, one for diff, one for sin, cos, etc. --
why would we want two syntaxes for if?

A uniform syntax is a big win all around. I don't want to tell new users,
"Oh, plot2d(if x > 0 then 1 else 0, ...) is wrong.
You want plot2d(if(x > 0, 1, 0), ...) instead".

All the best,
Robert