title: prolog function returning memory locations instead of values
body: <p>just started programming with prolog and I'm having a few issues.  The function I have is supposed to take a value X and copy it N number of times into M.  My function returns a list of N number of memory locations.  Here's the code, any ideas?</p>
  
  <pre><code>duple(N,_,M):- length(M,Q), N is Q.
  duple(N,X,M):- append(X,M,Q), duple(N,X,Q).
  </code></pre>