title: Scala forall to compare two lists?
body: <p>If I wan't to see if each element in a list corresponds correctly to an element of the same index in another list, could I use forall to do this? For example something like</p>
  
  <pre><code>val p=List(2,4,6)
  val q=List(1,2,3)
  p.forall(x=&gt;x==q(x)/2)
  </code></pre>
  
  <p>I understand that the x isn't an index of of q, and thats the problem I'm having, is there any way to make this work?</p>