# How to store the values of a function in a file

As it is well known, it is possible to define a function that remembers its values once its evaluated, using the following code:

f[x_]:=f[x]=rhs


During the day I evaluate f[x], for many x's, and I do not know/remember at which values of x I evaluated this. These values wont need to be evaluated again until I close mathematica, but if I close it, they will be lost. Is there a way to avoid this? To store these values somehow, so that I can use them the next time I open mathematica?

• save = DownValues[f] places the arguments and corresponding values of f in save. – bbgodfrey Jun 27 at 3:57
• Look at documentation for DumpSave – Bob Hanlon Jun 27 at 4:56
• @BobHanlon Much better than my answer. Thanks. – bbgodfrey Jun 27 at 5:01
• I think DumpSave is storing only the definitions of the functions. The evaluations seem to be lost – Fisher Jun 27 at 14:01