So what you basically want is to spread the arg be...
# announcements
b
So what you basically want is to spread the arg before you call the func?
m
Yup. Just wondering if it's something JB considered to make possible.
{ (str, int) -> func(str, int) }
seems verbose compared to
(::func)
.
b
It would be a nice feature if you ask me, but not sure how easy it would be to implement
m
Sure it is possible. This is programming 😉
@mg6maciej
Copy code
fun func(arg: Map.Entry<Int, String>) = arg.value.toString()
val a = mapOf(1 to "A").map(::func)
m
I'd rather not have
arg.key
and
arg.value
instead of nicely named params inside the function.