Wednesday, October 19, 2011

Kotlin and delegation

I have harped on Java for some time to add language support for delegation. Well, Java is not headed that direction anytime soon. But Kotlin delivers!

Saying:

class Derived(b : Base) : Base by b

forwards method calls on "Derived" to "Base" through the instance of Base named "b". Nifty!.

Kotlin is so full of good ideas it's hard to know where to start.

No comments: