Florian
09/13/2019, 7:45 AMUnit
functions, right?Florian
09/13/2019, 7:45 AMLuca Nicoletti
09/13/2019, 7:46 AMspand
09/13/2019, 7:48 AMPrefer using an expression body for functions with the body consisting of a single expression.
spand
09/13/2019, 7:49 AMarve
09/13/2019, 7:51 AMfun massage(thing: Thing): Unit = thing.massage()
to highlight that it's a Unit functionFlorian
09/13/2019, 8:53 AMUnit
function is a bit misleadingLuca Nicoletti
09/13/2019, 8:53 AMLuca Nicoletti
09/13/2019, 8:53 AMspand
09/13/2019, 8:55 AMFlorian
09/13/2019, 8:55 AM=
seems to imply a meaningful value in my eyesLuca Nicoletti
09/13/2019, 8:55 AMLuca Nicoletti
09/13/2019, 8:55 AMFlorian
09/13/2019, 8:56 AMFlorian
09/13/2019, 8:56 AMLuca Nicoletti
09/13/2019, 8:56 AMLuca Nicoletti
09/13/2019, 8:56 AMspand
09/13/2019, 9:00 AMUnit
down to the caller just like any other value.Luca Nicoletti
09/13/2019, 9:01 AMFlorian
09/13/2019, 9:03 AMFlorian
09/13/2019, 9:03 AMFlorian
09/13/2019, 9:08 AMFlorian
09/13/2019, 9:09 AMspand
09/13/2019, 9:11 AMspand
09/13/2019, 9:12 AMFlorian
09/13/2019, 9:28 AMspand
09/13/2019, 9:37 AMfun dbAccess() = transaction {
}
As opposed to:
fun dbAccess() : Result {
return transaction {
doSoemthing()
}
}