Re: Re: Re-evaluation of Conditional expressions, wrong explanation

• To: mathgroup at smc.vnet.net
• Subject: [mg3511] Re: [mg3482] Re: Re-evaluation of Conditional expressions, wrong explanation
• From: Allan Hayes <hay at haystack.demon.co.uk>
• Date: Mon, 18 Mar 1996 00:59:51 -0500
• Sender: owner-wri-mathgroup at wolfram.com

```fateman at peoplesparc.cs.berkeley.edu (Richard J. Fateman)
>Subject: [mg3482] Re: Re-evaluation of Conditional expressions,
wrong explanation
Makes the following point
>>>>
Any explanation must, in particular, explain why "If" differs from
"f".
Thus [I abbreviate]

Clear[f,y,z,ww]
y=If[z,1,2];
z=True;y;
z=ww;y

If[z, 1, 2]  /* z is NOT evaluated to ww */

But
Clear[f,y,z,ww]
y=f[z,1,2];
z=True;y;
z=ww;y

f[ww, 1, 2] /* z is evaluated to ww */

******
Richard:
If has the attribute HoldAll:

Clear[y,z,ww]
SetAttributes[f, HoldAll];
y=f[z,1,2];
z=True;y;
z=ww;y

f[z, 1, 2] /* z is NOT evaluated to ww */

Maybe what we want is for the behaviour of If to be something like:

HoldAll when defined but subsequently drop the HoldAll (which
it seems only partially to do)

Allan Hayes
hay at haystack.demon.co.uk

==== [MESSAGE SEPARATOR] ====

```

• Prev by Date: Re: Backwards?
• Next by Date: Re: More on functions & derivatives
• Previous by thread: Re: Re-evaluation of Conditional expressions, wrong explanation
• Next by thread: Re: Mathematica and Windows 95 in Windows-Network