Mark
01/15/2020, 3:12 AMList<(Int) -> Unit>
but I’d rather be more explicit so define an interface MyFun: (Int) -> Unit
so that my list now looks like List<MyFun>
. However, now, to create such a MyFun
, I need to do something like object: MyFun { override invoke(val: Int) { //some stuff } }
. Does this mean I’m creating an extra object compared to with not using the interface? If so, is there a better way?Ruckus
01/15/2020, 3:17 AMtypealias MyFun = (Int) -> Unit
Mark
01/15/2020, 3:18 AMdiesieben07
01/15/2020, 8:57 AMAlowaniak
01/16/2020, 6:48 PMRuckus
01/16/2020, 8:22 PMfun interface
construct.