Re: What does FullForm[ ] actually do?
- To: mathgroup at smc.vnet.net
- Subject: [mg90501] Re: What does FullForm[ ] actually do?
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Fri, 11 Jul 2008 02:02:38 -0400 (EDT)
- Organization: The Open University, Milton Keynes, UK
- References: <g54oj0$eu9$1@smc.vnet.net>
AES wrote: <snip> > However, the FullForm[{a+b};] or FullForm[y={a+b};] examples seem to > show that executing FullForm[expr] returns the result of executing that > expr, not the expression itself . . . ? The documentation for FullForm reads, "FullForm acts as a 'wrapper', which affects display, but *not* evaluation." [1] The key point is, "[...] affects display, but *not* evaluation." In other words, the standard evaluation process *occurs* as usual -- as if FullForm was not there -- since FullForm has no specific attributes that tell it not to do so (HoldFirst, HoldRest, etc.). (Note that you can see the attributes attached to a symbol thanks to Attributes[].) Again, "[...] affects display, but *not* evaluation." Therefore, as for any other function that is not specifically set to prevent the evaluations of some or all of its arguments, the argument of FullForm are evaluated first, then the full form of the resulting expression is displayed. One way to prevent the evaluation of an expression is to wrap it inside HoldForm or Unevaluated or Defer or ... In[1]:= FullForm[Unevaluated[y = {a + b}]] Out[1]//FullForm= Unevaluated[Set[y, List[Plus[a, b]]]] On the same document about FullForm, some examples are worth looking at [2]: FullForm effects display but not evaluation: In[1]:= FullForm[Integrate[x^n, x]] Out[1]//FullForm= Times[Power[Plus[1, n], -1], Power[x, Plus[1, n]]] Apply FullForm to the evaluated integral: In[2]:= Integrate[x^n, x] Out[2]= 1 + n x ------ 1 + n In[3]:= FullForm[%] Out[3]//FullForm= Times[Power[Plus[1, n], -1], Power[x, Plus[1, n]]] Regards, - Jean-Marc [1] "FullForm", _MORE INFORMATION_, http://reference.wolfram.com/mathematica/ref/FullForm.html [2] "FullForm", _Properties & Relations_, http://reference.wolfram.com/mathematica/ref/FullForm.html