Florian
07/08/2019, 6:04 PMSteve
07/08/2019, 6:05 PMDico
07/08/2019, 6:07 PMinfix
means you can invoke a function without a dot qualified expression and parenthesesDico
07/08/2019, 6:07 PMoperator
is used for special language featuresDico
07/08/2019, 6:07 PMmp
07/08/2019, 6:07 PMThreadLocal<T>
and (...) -> T
(to populate the thread local), except that T
isn't going to be the same for every pair (might have a pair for a TL<String>
, and another for a TL<Foo>
). Is there a nice way to represent this in the type system?Dico
07/08/2019, 6:09 PMclass MyType<T>(val tl: ThreadLocal<T>, val otherthing: () -> T)
mp
07/08/2019, 6:09 PMMyType
such that I could iterate across it, have a val thing: T = block()
and write it to the threadlocal?mp
07/08/2019, 6:10 PMAny
but I'm hoping for a better approach than that...Dico
07/08/2019, 6:10 PMThreadLocal.withInitial { func() }
camdenorrb
07/08/2019, 8:05 PMcamdenorrb
07/08/2019, 8:21 PMcamdenorrb
07/08/2019, 8:21 PMcamdenorrb
07/08/2019, 8:21 PMsxtanna
07/08/2019, 8:22 PMMohamed Ibrahim
07/09/2019, 1:14 PMNir
07/09/2019, 8:41 PMkarelpeeters
07/10/2019, 2:25 PMAndrew Gazelka
07/11/2019, 4:38 AM.copy{}
work?mike_shysh
07/11/2019, 8:09 AMfun <T> newDecoratedFunction(actual: T, expected: T, functionInitial: (paramA: T, paramB: T) -> Unit) {
functionInitial(paramA, paramB)
additionalCode(paramA,paramB)
}
As a result, the usage is the following:
newDecoratedFunction(passedParameterA, passedParameterB) {
paramA: SomeType1, paramB: SomeType2 -> functionInitial(paramA, paramB)
}
elect
07/11/2019, 9:52 AM~\.m2\repository\org\jetbrains\kotlin\kotlin-stdlib
)Marko Mitic
07/11/2019, 3:06 PMxenoterracide
07/11/2019, 5:35 PMvlad.minaev
07/12/2019, 10:57 AMprojectionOf(Todo::class) {
title, //<- only properties of Todo allowed here
completed
}
dave08
07/14/2019, 3:53 PM@Nullable
V get(@NonNull K key, @NonNull Function<? super K, ? extends V> mappingFunction);
My current implementation doesn't seem to be right (the IDE is still using the original function and not mine...):
inline fun <reified K, V> Cache<in K, V>.get(key: K, crossinline mapping: suspend (K) -> V?): V? =
get(key) { runBlocking(<http://Dispatchers.IO|Dispatchers.IO>) { mapping(key) } }
What could be wrong?Sean Massie
07/14/2019, 9:51 PMursus
07/15/2019, 12:58 AMursus
07/15/2019, 12:58 AM