I am trying to understand DownValues
in regards to the evaluation of its output. Consider this:
In[1]:= f[x_] := 1 + 1;
In[2]:= DownValues[f]
Out[2]= {HoldPattern[f[x_]] :> 1 + 1}
So far so good. Now lets change f so that it includes a graphic:
In[3]:= f[x_] := Graphics[Circle[]]
In[3]:= DownValues[f]
It works, but why the 1 + 1 remains unevaluated while the Graphics command is evaluated? This becomes a problem in a case like this:
In[4]:= f[r_] := Graphics[Circle[{0, 0}, r]]
In[4]:= DownValues[f]
Is this the expected behavior? Is there a way to prevent the evaluation of the definitions returned by DownValues?
I am using Mathematica 10.1 / Win7
Motivation: I was exploring the idea of creating a code analysis function to help me create function calls graphs. For this, I need to be able to fetch the unevaluated definitions of all the functions defined in the Global` context.