title: Common lisp push from function
body: <p>I have the following common lisp functions: <code>(aggregate line1 line2)</code> and <code>(queuer data result)</code>.</p>
  
  <p><code>queuer</code> should push into result either the values <code>line1</code> and <code>line2</code> if they have the 1st field different, or the aggregate of those 2 lines if they have the 1st field equal.</p>
  
  <p>I do not know why it doesn't change my result list.</p>
  
  <p><em>Note:</em> I am initializing the result list with a <code>(push (pop data) result)</code> to have the first element there. The 2 lists are 1-depth nested lists <code>(("1" "text") ("2" "text") (...))</code>.</p>
  
  <pre><code>(defun aggregate (line1 line2)
    (progn
      (list 
       (nth 0 line1)
       (nth 1 line1)
       (nth 2 line1)
       (concatenate 'string (nth 3 line1) ", " (nth 3 line2))
       (concatenate 'string (nth 4 line1) ", " (nth 4 line2)))))
  
  (push (pop x) y)
  
  (defun queuer (data result)
    (loop do
         (let ((line1 (pop data))
               (line2 (pop result)))
           (if (equal (first line1) (first line2))
               (progn
                 (push (aggregate line1 line2) result)
                 (print "=="))
               (progn
                 (push line2 result)
                 (push line1 result)
                 (print "&lt;&gt;"))))
         while data))
  </code></pre>
  
  <p>Thank you for any insights.</p>