Open DavidPerezIngeniero opened 1 year ago
Another improvement is the implementation of componentN()
, so that Tuple2 is equivalent in usage to Pair.
Another improvement is the implementation of
componentN()
, so that Tuple2 is equivalent in usage to Pair.
Kotlin compiler will generate componentN()
functions for data classes. Tuple2
is almost the same with Pair
.
Another improvement is the implementation of
componentN()
, so that Tuple2 is equivalent in usage to Pair.Kotlin compiler will generate
componentN()
functions for data classes.Tuple2
is almost the same withPair
.
That's true. Sorry, I'm a newbie in Kotlin.
Are you interested in a patch or do I make my own fork?
I've changed a little
Generator.kt
, so that allTuple1
,Tuple2
, .... inherit fromTuple
:This allows me to do generic programming with a tuple of any size. Simple example:
even though I lose static type info when using generic programming.
Of course, I can provide a patch for this. For completeness, an empty Tuple could also be created. In Scala the empty tuple is written as:
()