This thread has a few suggestions you might find helpfuL: In Julia, how to create a function that saves its own internal state?
This thread has a few suggestions you might find helpfuL: In Julia, how to create a function that saves its own internal state?