Open jigga opened 5 years ago
Hi Arek,
The truck -> can be removed and truck can be replaced with it.
The only disadvantage of this solution is that left, right, and straight are in the package level instead of being within the Truck object.
Regards,
Venkat
So I'm trying to wrap my head around lambdas with receiver and actually have just discovered that the function type for the block argument of the operate function don't have to be Truck.(Truck) -> Unit, but can simply be (Truck) -> Unit. Here's my working solution:
Any thoughts on that?
Thanks, Arek