MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

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.






  • Prev by Date: Re: Bug in ListContourPlot?
  • Next by Date: Problem with "Point" light sources in Mathematica 7.01
  • Previous by thread: ListPlot markers not centered properly
  • Next by thread: Problem with "Point" light sources in Mathematica 7.01