title: Using append in Prolog
body: <p>I am very new to Prolog and I am experimenting using 'append'. I am trying to write a very simple program that takes the first item of a list, and add's it to an empty list L.</p>
  
  <p>Would someone please explain to me why this won't work?!</p>
  
  <pre><code>add_first([A|_],L) :- append(A,_,L).
  </code></pre>
  
  <p>Another quick question. </p>
  
  <p>Why does this code work?</p>
  
  <pre><code>add_first([A|B],L) :- append(B,A,L).
  </code></pre>
  
  <p>But this code doesn't? </p>
  
  <pre><code>add_first([A|B],L) :- append(A,B,L).
  </code></pre>
  
  <p>Thanks a lot.</p>