Does Java support some form of pure-function annotation resulting in the compiler caching results in order to avoid re-calculation of a result.
The context is essentially traversing a graph. I'm not wanting to re-visit already-visited sections of the graph.
I can do this using a stack / visited set. However, this stack code seems like what's already going on in the call-stack - but more complicated for the code-reader. The only missing component is the visited
set implementation.
Is this a thing? Would be cool...