MathGroup Archive 2011

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

Search the Archive

Question on Unevaluated

  • To: mathgroup at smc.vnet.net
  • Subject: [mg117264] Question on Unevaluated
  • From: Alexey <lehin.p at gmail.com>
  • Date: Sun, 13 Mar 2011 05:26:42 -0500 (EST)

Hello,

I am puzzled a bit by the Documentation for Unevaluated. Under "More
information" field we read:

"f[Unevaluated[expr]] effectively works by temporarily setting
attributes so that f holds its argument unevaluated, then evaluating
f[expr].".

After reading this I expect that

f[Unevaluated[1 + 1]; 2 + 1]

will be returned completely unevaluated as it is when I set HoldFirst
attribute to f:

In[2]:= SetAttributes[f, HoldFirst]
f[Unevaluated[1 + 1]; 2 + 1]

Out[3]= f[Unevaluated[1 + 1]; 2 + 1]

But in really we get

In[1]:= f[Unevaluated[1 + 1]; 2 + 1]

Out[1]= f[3]

This leads me to a question: what is implied in documentation? Which
attributes are temporarily set and to which function?


  • Prev by Date: Re: Wolfram, meet Stefan and Boltzmann
  • Next by Date: Re: CDF player and opening non-Mathematica files
  • Previous by thread: Re: Joining points of ListPlot
  • Next by thread: Re: Question on Unevaluated