Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #1924

thoughts on how to explain this functionality?

From "Scot T. Martin" <smartin@seas.harvard.edu>
Newsgroups comp.soft-sys.math.mathematica
Subject thoughts on how to explain this functionality?
Date 2011-04-30 09:52 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <ipgm48$8pt$1@smc.vnet.net> (permalink)

Show all headers | View raw


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.




Back to comp.soft-sys.math.mathematica | Previous | NextNext in thread | Find similar | Unroll thread


Thread

thoughts on how to explain this functionality? "Scot T. Martin" <smartin@seas.harvard.edu> - 2011-04-30 09:52 +0000
  Re: thoughts on how to explain this functionality? Stefan <wutchamacallit27@gmail.com> - 2011-05-01 10:21 +0000

csiph-web