I need to implement a general method that takes a tuple and returns a map Example:
val tuple=((1,2),(("A","B"),("C",3)),4)
I am trying to break this tuple into a list:
val list=tuple.productIterator.toList Scala>list: List[Any] = List((1,2), ((A,B),(C,3)), 4)
But this method returns List [Any].
Now I'm trying to figure out how to iterate over the following tuple, for example:
((1,2),(("A","B"),("C",3)),4)
to iterate over each element 1,2, "A", B ", ... etc. etc. How could I do such an iteration over a tuple
Echo
source share