https://kotlinlang.org logo
Title
s

simon.vergauwen

02/22/2023, 3:12 PM
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
s

streetsofboston

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.
s

simon.vergauwen

02/22/2023, 3:48 PM
Yes, exactly.
d

dave08

02/22/2023, 4:10 PM
I see what you mean...thanks!