Hello I'm wandering what can the advantage of havi...
# coroutines
e
Hello I'm wandering what can the advantage of having such kind of structure ?
l
Genericity, and you can still get a specific class to implement it directly.
Here, I have a
SuspendLazy
interface. I could make it implement that suspend interface: https://splitties.louiscad.com/modules/coroutines/#suspending-version-of-lazy
e
There is difference between implementing an interface such
SuspendLazy
and extending a suspend function ?
l
It's implementing, not extending a suspend function
The difference is only about the type. Here, the
SuspendLazy
interface would not be that needed actually.
Regardless, it's great for consistency that this is now possible as it was for non-suspending functions.
e
Okay I get it, but seems like it will be very useful when it came to have a class hierarchy
But when it can to have something like Command pattern it can be really interesting