Tuples deprecated?


I noticed recently that Tuples are deprecated and going to be removed from Kotlin. Why is that? And do you plan to support multiple return values from function in some other way?


Look examples http://kotlin-demo.jetbrains.com/?folder=Multi-declarations&name=Multi-declarations


Have a look at this blog post http://blog.jetbrains.com/kotlin/2012/09/how-do-you-traverse-a-map/


Thank you both for answers.


There's a more compact way to do multiple returns if you use the constructor of a class as the function:

// class constructor contains the logic, no need for a separate function. class only exists to act as a function class foo() {   val returnVal1 = ...   val returnVal2 = ... }

// use it
val f = foo()

I don’t think there’s a way to use this with multiple assignment, but you have the property names defined in the class so it doesn’t really matter.

Andrey mentioned this approach in a blog post or comment somewhere but I can’t find it.


I just found another blog post that provides some info on this subject: