thoughts on how to explain this functionality?
- To: mathgroup at smc.vnet.net
- Subject: [mg118505] thoughts on how to explain this functionality?
- From: "Scot T. Martin" <smartin at seas.harvard.edu>
- Date: Sat, 30 Apr 2011 05:51:56 -0400 (EDT)
In[1]:= x = 5 Out[1]= 5 In[2]:= With[{valueQ = If[ValueQ[ReleaseHold[Hold[#]]], #, False] &}, valueQ@x] Out[2]= 5 In[3]:= With[{valueQ = If[ValueQ[#], #, False] &}, valueQ@x] Out[3]= False Anyone have thoughts on why Out[2] and Out[3] are different? It seems to me that a ReleaseHold[Hold[...]] formulation would net out to no effect, yet the effect is apparent. My desired output is Out[2] but the formulation of ReleaseHold[Hold[...]] is not elegant.