Some languages have annotations or macros for auto...
# advent-of-code
o
Some languages have annotations or macros for automatically memozing a function. Does it make sense to have something like that in Kotlin stdlib? Similar to https://arrow-kt.io/learn/collections-functions/memoize/
d
The combination of expression function syntax,
MutableMap.getOrPut
, and data classes make this so easy to implement it doesn't really seem necessary. The first time I encountered such a problem I looked for the equivalent of
functools.lru_cache
but was satisfied with what the stdlib already provides. That and, while I've used caches (primarily the Guava cache library) plenty of times while professionally programming, pure unbounded memorization just doesn't really come up outside of challenge problems.
👌 1