I just intuitively tried if tuple apply works with static indices, and it does, which is very cool. I don't know if that should be the preferred way to access them? I.e. instead of
case class Person(name: String)
val t = (11, "eleven", Person("Eleven"))
t._1 // 11
t._2 // "eleven"
t._3 // Person("Eleven")
https://github.com/scala/docs.scala-lang/blob/main/_overviews/scala3-book/taste-collections.md
I just intuitively tried if tuple
apply
works with static indices, and it does, which is very cool. I don't know if that should be the preferred way to access them? I.e. instead ofwould it be better to write
?