Why are delegates (as in `val a: Int by lazy { 5 }...
# announcements
c
Why are delegates (as in
val a: Int by lazy { 5 }
not an interface? Instead they are weird classes that have to have certain methods without specifying an interface... I would like to write a
and
infix function that creates a delegate that combines two others, but I'm afraid that won't be possible because of this
c
All operators are implemented without interfaces, too. It’s just the convention. But there are
ReadWriteProperty
and
ReadOnlyProperty
to aid with this, which implements the necessary functions for
var
and
val
delegates, respectively