nickk
08/29/2018, 1:26 PMIterable.reduce
, why is T
constrained to be a subtype of S
?
As long as operation
produces the correct type, what is the problem?
public inline fun <S, T : S> Iterable<T>.reduce(operation: (acc: S, T) -> S): S
g4sarma
08/29/2018, 3:04 PMAllan Wang
08/29/2018, 4:34 PMuser
08/29/2018, 6:32 PMhttps://pbs.twimg.com/media/DlyUMgdWwAAsY1E.jpg▾
qwert_ukg
08/29/2018, 8:01 PMval __name: String by lazy {
createHTML().small {
+name
}
}
like as my own delegate builder `html`:
val __name: String by html {
small {
+name
}
}
dharrigan
08/30/2018, 9:08 AMGta
08/30/2018, 12:45 PMprivate fun runTasks (gradleLambda: (ProjectConnection) -> List<GradleTask>) { ... }
private fun runTasks (gradleLambda: (ProjectConnection) -> String) { ... }
Fré Dumazy
08/30/2018, 2:07 PMJakub
08/30/2018, 3:03 PMlifter
08/30/2018, 3:09 PMjustAddThem1
such that it takes any numeric type?
justAddThem2
and justAddThem3
won't compile.
fun justAddThem1(x: Int, y: Int) = x + y
fun justAddThem2(x: Number, y: Number) = x + y
fun <T : Number> justAddThem3(x: T, y: T) = x + y
Hele
08/30/2018, 4:47 PMmatt tighe
08/30/2018, 4:55 PMFile.writeBytes()
is async?karelpeeters
08/31/2018, 10:21 AMkarelpeeters
08/31/2018, 10:24 AMpablisco
08/31/2018, 10:31 AMAyden
08/31/2018, 10:37 AMagrosner
08/31/2018, 11:55 AMHullaballoonatic
08/31/2018, 4:10 PMkarelpeeters
08/31/2018, 4:19 PMHullaballoonatic
08/31/2018, 4:19 PMSlackbot
08/31/2018, 5:51 PMchristophsturm
09/02/2018, 1:48 PMNikky
09/02/2018, 10:13 PMprintln { "" }
prints: () -> kotlin.String
is that because println accepts Any so i can pass it a KFunction<String> ?
i think there should be a println overload that takes () -> Any
and passes it to the normal println after executingNikky
09/02/2018, 10:20 PMNikky
09/02/2018, 10:21 PMSamoxive
09/03/2018, 11:28 AMfun blockingFunction(): Int {
val foo = blockingFoo();
val bar = blockingBar(bar);
val baz = blockingBaz(bar);
}
normally, you would run this in an executor, get the integer via a future object or somethingSamoxive
09/03/2018, 11:29 AMblockingFunction
into suspend
function or would the three functions inside also need to be converted for the best implementation?pavlospt
09/03/2018, 12:57 PMext
properties in another module’s build.gradle.kts
?Nikky
09/03/2018, 4:21 PMegorand
09/03/2018, 6:59 PM