title: define a function with tuples
body: <p>How can I define a function that is accepting all the tuples(1 to 22) as argument, I have something as follows in mind:</p>
  
  <pre><code>def foo (v=Tuple) =...
  
  foo((1,2))
  foo((1,2,3))
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>To answer the comment: I am actually trying to create a Tensor class which is a set of values and a set of indices. The indices can be covariant and/or contravariant (cf <a href="http://en.wikipedia.org/wiki/Covariance_and_contravariance_of_vectors" rel="nofollow">Wikipedia1</a> and <a href="http://en.wikipedia.org/wiki/Einstein_notation" rel="nofollow">Wikipedia2</a>). I wanted to have a special syntax like <code>Tensor((1,2),(3,4),values)</code> which would create a tensor with <code>values</code>, two covariant indices having length <code>(2,3)</code> and two contravariant indices with length <code>(3,4)</code>. So using this syntax I could also write <code>Tensor((1,2,3),3,values)</code> (with an implicit Int=>Tuple1).</p>
  
  <p>I agree that <code>Tuple</code>s are not suitable for this, better to use <code>List</code>s. However the syntax is not so nice then...</p>