It might be a trivial question but I haven't been able to find solution myself. Suppose that I have a calculation whose rather long output that is dependent in some variable e.g. x, I want it to be the body of a newly defined function. Schematically, what I would like is
In[1]:= SomethingIsDone[...]
Out[1]:= (...really long expression dependent on x)
In[3]:= f[x_]:= % ;
But the problem is that the above doesn't work. Any ideas?
f[x_] = SomethingIsDone[...]? (UseSet(=) instead ofSetDelayed(:=))? – march Feb 25 '20 at 17:35f, to perform theSomethingIDone[...]. It's not efficient. – hal Feb 25 '20 at 17:54%), so the only way to do it is withSetand not withSetDelayed. Maybe this is the reason that so far it didn't work... – hal Feb 25 '20 at 18:04