Johann Pardanaud
05/10/2023, 3:48 PMlist.forEach {
with(it) {
// I want each value of the list as a receiver, not as a parameter.
}
}
Am I missing an existing method or should I write my own receiveEach
extension method?Rob Elliot
05/10/2023, 3:53 PMfun <T> List<T>.receiveEach(f: T.() -> Unit) = forEach { it.f() }
I can't see anything like it in the stdlib.Johann Pardanaud
05/10/2023, 3:54 PMPaul Griffith
05/10/2023, 3:54 PMJohann Pardanaud
05/10/2023, 3:54 PMJohann Pardanaud
05/10/2023, 3:54 PMJohann Pardanaud
05/10/2023, 3:55 PMasdf asdf
05/10/2023, 6:22 PM