4 ms·
What's heavy-handed about Kotlin's apply? It's just an extension function in the standard library (so not a separate language feature, if that's what you mean b
by ptx 5y ago
What's heavy-handed about Kotlin's apply? It's just an extension function in the standard library (so not a separate language feature, if that's what you mean by "heavy"?) and solves the problem cleanly IMHO.
You can easily implement a similar extension function in C#, although the syntax is slightly uglier and you don't get the implicit receiver in the lambda.
- BoardsOfCanada 5y agoI just mean it looks a bit more obtrusive to me than just .. I agree that it speaks volumes about the power of the language itself.