Re: Question on Unevaluated
- To: mathgroup at smc.vnet.net
- Subject: [mg117301] Re: Question on Unevaluated
- From: JJ <wateronwildfire at gmail.com>
- Date: Mon, 14 Mar 2011 06:01:06 -0500 (EST)
Hi, I am not sure, but maybe the problem is that you wrote f[a;b] instead of f[a,b] or f[{a,b}] (if it is listable). The ";" is telling to output only f[b]. 2011/3/13 Alexey <lehin.p at gmail.com> > 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? > >