About Condition and HoldAll
- To: mathgroup at smc.vnet.net
- Subject: [mg76030] About Condition and HoldAll
- From: solidifire <barabbasgospel at yahoo.com.tw>
- Date: Tue, 15 May 2007 04:48:59 -0400 (EDT)
In[1]:= {f[1 + 1, 2 + 3], g[1 + 1, 2 + 3], h[1 + 1, 2 + 3]} Out[1]= {f[2, 5], g[2, 5], h[2, 5]} In[2]:= SetAttributes[f, HoldAll] In[3]:= SetAttributes[g, HoldRest] In[4]:= {f[1 + 1, 2 + 3], g[1 + 1, 2 + 3], h[1 + 1, 2 + 3]} Out[4]= {f[1 + 1, 2 + 3], g[2, 2 + 3], h[2, 5]} In[5]:= Attributes[Condition] Out[5]= {HoldAll, Protected} In[6]:= Condition[1 + 1, 2 + 3] Out[6]= 2 /; 2 + 3 The version of Mathematica is 5.0 for Microsoft Windows. My question is that why does Condition behave as having HoldRest as attribute although the attribute is HoldAll actually?
- Follow-Ups:
- Re: About Condition and HoldAll
- From: Andrzej Kozlowski <akoz@mimuw.edu.pl>
- Re: About Condition and HoldAll