dharrigan
08/10/2017, 8:30 AMbody().doSomething()?
menegatti
08/10/2017, 8:31 AMdiesieben07
08/10/2017, 8:31 AMBar
(whatever type that is) is available as this
inside the lambda. It's called a lambda with receiver.menegatti
08/10/2017, 8:31 AMdharrigan
08/10/2017, 8:33 AMbody().doSomething()
is that possible? (am I being clear?).diesieben07
08/10/2017, 8:34 AMsomeBarInstance.body()
.dharrigan
08/10/2017, 8:34 AMdiesieben07
08/10/2017, 8:34 AMUnit
, which does not have any (useful) methods. But in theory, yes, you can.dharrigan
08/10/2017, 8:34 AMmcscruff
08/10/2017, 10:44 AMstefano.maffullo
08/10/2017, 10:45 AMmannodermaus
08/10/2017, 10:50 AMMap
that cares about the insertion order of entries. LinkedHashMap
does, so make sure you use that, then grab its keySet()
and obtain the key from theremcscruff
08/10/2017, 11:02 AMmcscruff
08/10/2017, 1:50 PMstefano.maffullo
08/10/2017, 1:58 PMmcscruff
08/10/2017, 2:47 PMferoz_baig
08/10/2017, 2:58 PMcdurham
08/10/2017, 5:11 PModay
08/10/2017, 6:52 PModay
08/10/2017, 6:53 PMdalexander
08/10/2017, 6:58 PMagomez
08/10/2017, 6:59 PModay
08/10/2017, 7:01 PModay
08/10/2017, 7:12 PMif
as an expression, in a when
oday
08/10/2017, 7:12 PMelse
, is there a way to supply it in a pretty way instead of else { }
or am I just being nonsensically anal?dalexander
08/10/2017, 7:14 PMwhen
to a variable? Otherwise I wouldn’t expect you would need to do that.kevinmost
08/10/2017, 7:16 PMwhen(cond) {
branch -> {
if (otherCond) foo()
}
}
kevinmost
08/10/2017, 7:16 PModay
08/10/2017, 7:25 PModay
08/10/2017, 7:26 PM