poohbar
11/30/2017, 2:43 PMyole
11/30/2017, 2:43 PMpoohbar
11/30/2017, 2:44 PMyole
11/30/2017, 2:45 PMpoohbar
11/30/2017, 2:46 PMpoohbar
11/30/2017, 2:46 PMyole
11/30/2017, 2:51 PMpoohbar
11/30/2017, 2:51 PMpoohbar
11/30/2017, 2:52 PMbitkid
11/30/2017, 8:46 PMbitkid
11/30/2017, 8:46 PMtrevjones
11/30/2017, 8:47 PMbitkid
11/30/2017, 8:47 PMuser
11/30/2017, 8:51 PMbitkid
11/30/2017, 8:51 PMuser
11/30/2017, 8:55 PMval foodModel = FoodModel(amountOfEnergy, energyRecommendation, viewModels, recommendedFoods)
return combineLatest(foodModel, ::FoodSummaryModel)
user
11/30/2017, 8:56 PMuser
11/30/2017, 9:29 PMuser
11/30/2017, 9:30 PMuser
11/30/2017, 9:30 PMuser
11/30/2017, 9:32 PMAnd finally third, if you have lambda as last parameter, why not get it out of parenthesis?and maybe my second comment on the snippet, depending on it being nonsense or not 🙂 Cheers 🙂
user
11/30/2017, 9:33 PMa, b, c, d
to a, e, v, r
if you're keeping 4 separate params 🙂Paul Woitaschek
11/30/2017, 9:34 PMPaul Woitaschek
11/30/2017, 9:34 PMPaul Woitaschek
11/30/2017, 9:37 PMCzar
11/30/2017, 9:45 PMCzar
12/01/2017, 8:13 AMmove lambda argument outside of parentheses
for whole file at once?
This is a pretty frequent task for us when converting Java to Kotlin.stkent
12/04/2017, 7:52 PMfor (element in this) if (!predicate(element)) return false
return true
says "if any element does not match the predicate, return false; otherwise, return true".
Second version:
return this.any { predicate(it) }
says "if any element matches the predicate, return true; otherwise, return false".
These are not equivalent, right?karelpeeters
12/05/2017, 7:55 AM2017.3
.karelpeeters
12/05/2017, 7:58 AM