You could use a functor, for example: In Julia, how to create a function that saves its own internal state? - #6 by lmiq
Related topics
Topic | Replies | Views | Activity | |
---|---|---|---|---|
Something like C++ static declaration for functions in Julia? | 15 | 1115 | June 3, 2020 | |
Emulate local static variable? | 5 | 5330 | December 15, 2016 | |
Static variable in a templated function or struct | 1 | 247 | October 1, 2022 | |
In Julia, how to create a function that saves its own internal state? | 10 | 2692 | April 7, 2021 | |
Define another function in the definition of a function | 9 | 621 | March 24, 2024 |