| Author |
Comment/Response |
Peter Pein
|
10/21/12 5:19pm
Hi,
Bill's solution works of course but i guess you wanted to know why your attempt did not.
In[1]:= f = 3 x
Out[1]= 3 x
In[2]:= Function[x, f][Pi]
Out[2]= 3 x
does not work because Function does not evaluate its arguments:
In[3]:= Attributes[Function]
Out[3]= {HoldAll, Protected}
In[4]:= Function[x, Evaluate[f]][Pi]
Out[4]= 3 Pi
does what you expect.
Peter
URL: , |
|