MathGroup Archive 2011

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

Search the Archive

HoldAll/HoldRest // updated

  • To: mathgroup at smc.vnet.net
  • Subject: [mg118489] HoldAll/HoldRest // updated
  • From: "Scot T. Martin" <smartin at seas.harvard.edu>
  • Date: Fri, 29 Apr 2011 07:34:42 -0400 (EDT)

Fixing small but important typos from email of a few minutes ago.... and re-posting:



Some kind of issue going on here between the interactions of HoldAll and HoldRest of ValueQ[...], If[...], and Function[...]. Anyone know the solution so that Out[3] results in 5?



In[1]:= valueQ = If[ValueQ[#], #, False] &



Out[1]= If[ValueQ[#1], #1, False] &



In[2]:= x = 5



Out[2]= 5



In[3]:= valueQ[x]



Out[3]= False



In[4]:= If[ValueQ[x], x, False]



Out[4]= 5


  • Prev by Date: Re: How to create such a list
  • Next by Date: Re: How to create such a list
  • Previous by thread: Mathematica 8 Free-Form linguistic input
  • Next by thread: Solve / Reduce isolating results.