title: Matching tuples in Prolog
body: <p>Why does Prolog match <code>(X, Xs)</code> with a tuple containing more elements? An example:</p>
  <pre><code>test2((X, Xs)) :- write(X), nl, test2(Xs).                                    
  test2((X)) :- write(X), nl.                                                   
                                                                                
  test :-                                                                       
          read(W),                                                               
          test2(W). 
  
  ?- test.
  |: a, b(c), d(e(f)), g.
  a
  b(c)
  d(e(f))
  g
  yes
  </code></pre>
  <p>Actually this is what I want to achieve but it seems suspicious. Is there any other way to treat a conjunction of terms as a list in Prolog?</p>