https://kotlinlang.org logo
#announcements
Title
# announcements
b

bjartek

04/07/2017, 7:45 PM
So what you basically want is to spread the arg before you call the func?
m

mg6maciej

04/07/2017, 10:40 PM
Yup. Just wondering if it's something JB considered to make possible.
{ (str, int) -> func(str, int) }
seems verbose compared to
(::func)
.
b

bjartek

04/08/2017, 12:37 PM
It would be a nice feature if you ask me, but not sure how easy it would be to implement
m

marcinmoskala

04/11/2017, 10:42 PM
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

mg6maciej

04/11/2017, 10:51 PM
I'd rather not have
arg.key
and
arg.value
instead of nicely named params inside the function.