That is actually quite dangerous, since it disregards caching policies, etc. So it would really be a half-baked caching strategy that would probably result in many short-coming pretty quickly.
I like this Kotlin wrapper for Caffeine though. https://github.com/sksamuel/aedile
02/22/2023, 3:17 PM
Memoization works only for pure functions, correct?
If so, caching would work, since the returned result would always be the same...
And if the function is not pure, memoization couldnt be used.