title: Iterate over arbitrary-length tuple
body: <p>I just started with Scala and ran into a problem:</p>
  
  <p>Scala has the Types <code>Tuple1</code>, <code>Tuple2</code>, …, <code>Tuple22</code>. Scalaquery returns tuples when iterating over queries.</p>
  
  <p>I have now a given class (ZK’s <code>ListitemRenderer</code>), which accepts <code>Object</code>s and populates gui lists with rows, each consisting of some cells. But <code>ListitemRenderer</code> isn’t generic. So my problem is that i have an <code>Object</code> “data”, which really is a tuple of arbitrary length, which i have to iterate over to create the cells (simply with <code>data._1.toString</code>, …).</p>
  
  <p>Since <del>there is no</del> <strong>I didn’t know the</strong> supertype to <code>Tuple1-22</code>, i <del>can’t</del> <strong>couldn’t</strong> just do <code>data.asInstanceOf[Tuple].productIterator foreach {…}</code></p>
  
  <p>What can i do?</p>
  
  <hr>
  
  <p>Below Answer told me that there is indeed a Trait to all Tuples – <code>Product</code> – providing the desired <code>foreach</code> function.</p>