Hi guys. As far as I understand, Kotlin doesn't pr...
# language-proposals
h
Hi guys. As far as I understand, Kotlin doesn't provide a way to reference an anonymous function literal from inside it e.g.
listOfAny.forEach { if (it is List) it.forEach(this@forEach) else println(it) }
. If there was a way to reference current anonymous function, it would make possible recursive calls from anonymous functions (above) and some other things like unsubscribing (
removeListener(this@addListener)
). Is there a reason for not implementing this or can this be considered a language proposal?