Slackbot
09/23/2019, 11:48 AMthana
09/23/2019, 12:20 PMCache<> doesn't exist in kotlin you need to specify the types inside the bracketscedric
09/23/2019, 6:09 PMCache as well.Amir Gur
09/24/2019, 10:48 PM<> from : Cache<>
2. Add : Void otherwise won't compile:
- fun put(key: K, value: V) : Void
- fun evict(key: K) : VoidAmir Gur
09/25/2019, 12:01 AM<>, or <K, V> are allowed after : Cache.
For instance you could extend a generic one this way: interface Cache<K, V> : javax.cache.Cache<K,V> { ... }Tuang
09/25/2019, 8:26 AMTuang
09/25/2019, 8:33 AMregistrar: (key: K) -> V?)
In the following function
fun getOrPut(key: K, fun getOrPut(key: K, registrar: (key: K) -> V?): V?: V?
i thinks registrar is something likes the arguments name, so what are the rest?
is it a lambda ?thana
09/25/2019, 9:00 AM(key: K) -> V?) is the signature of a lambda type, yes (yet, the key could be avoided, so it's pretty much the same like (K) -> V?)Tuang
09/25/2019, 9:04 AM