Ruckus
10/04/2017, 9:24 PMedvin
10/04/2017, 9:28 PMedvin
10/04/2017, 9:28 PMedvin
10/04/2017, 9:52 PMedvin
10/04/2017, 10:01 PMedvin
10/04/2017, 10:17 PM?: run { someCode() }
in several places. It seems wasteful to create a function instance and executing it instead of just writing inline code. Is it really worth it to avoid the traditional approach of if/else
?horse_badorties
10/04/2017, 10:18 PMedvin
10/04/2017, 10:20 PMhorse_badorties
10/04/2017, 10:21 PMedvin
10/04/2017, 10:24 PMedvin
10/04/2017, 10:35 PMmelston
10/04/2017, 10:44 PMedvin
10/04/2017, 10:45 PMedvin
10/04/2017, 10:45 PMmelston
10/04/2017, 10:47 PMedvin
10/04/2017, 10:47 PMedvin
10/04/2017, 10:48 PMmelston
10/04/2017, 10:56 PMedvin
10/04/2017, 11:00 PMedvin
10/04/2017, 11:00 PMmelston
10/04/2017, 11:02 PMedvin
10/04/2017, 11:03 PMedvin
10/04/2017, 11:10 PMcypher121
10/05/2017, 1:05 AMobject GameOptions {
var paused by property(true)
fun pausedProperty() = getProperty(GameOptions::paused)
}
does not compile since properties in objects are KMutableProperty0, they don't take class instance as the argumentcypher121
10/05/2017, 1:05 AMedvin
10/05/2017, 2:43 AMobject
makes sure getProperty
doesn't match Any
. But do you really need/want this syntax? I would really recommend the new property syntax instead. Much more transparent, and also faster.edvin
10/05/2017, 2:43 AMcypher121
10/05/2017, 2:44 AMedvin
10/05/2017, 2:48 AM