1
$\begingroup$

I'm inspired to make use of "remembering the function values" technique from here: Functions that remember their values

The only question is: how can I save the function, along with its values stored as well, into some kind of file, so that next time when I load the file, i.e., the function into Mathematica, I can access all the values I stored last time.

$\endgroup$
3
  • 2
    $\begingroup$ I think that's what DumpSave is for. Note however that DumpSave creates a .mx file, which to my understanding is a file format that isn't very cross-platform (and maybe even cross-version) compatible. $\endgroup$
    – march
    Commented Aug 8, 2016 at 23:00
  • 1
    $\begingroup$ Save also will work. All this is described in my own answer (2008) for which I would consider this question "already has an answer" (i.e. duplicate) but I do not wish to vote alone. $\endgroup$
    – Mr.Wizard
    Commented Aug 9, 2016 at 0:01
  • 2
    $\begingroup$ Strongly related: "The best way to construct a function with memory." $\endgroup$ Commented Aug 9, 2016 at 6:57

1 Answer 1

0
$\begingroup$

DynamicModule[{x,y, ...]},expr] represents an object which maintains the same local instance of the symbols x, y, ...] in the course of all evaluations of Dynamic objects in expr. Symbols specified in a DynamicModule will by default have their values maintained even across Wolfram System sessions.

$\endgroup$
1
  • 1
    $\begingroup$ I don't think DynamicModule is meant for this purpose ... $\endgroup$
    – Szabolcs
    Commented Aug 9, 2016 at 11:08

Not the answer you're looking for? Browse other questions tagged or ask your own question.