title: Appending Elements to an Existing List in Scheme
body: <p>I need some help understanding the syntax on how to append a number into a list, i'm doing this from user input via the console so this elements have to be entered in recursively. So for ever number that is entered, the list must grow for each element (only numbers) added.</p>
  
  <p>Here is the code I am working with, the problem lies in the second conditional. Right now this works but only creates an empty list of each number I put in, so the results would be</p>
  
  <pre><code> &gt;12
   &gt;202
   &gt;30
   ()()()
   zero input: stopping list
  
  
  (define (inputlist)
  (let ((applist list))
  (let ((inpt (read)))
    (cond
    ((= inpt 0)(newline) (display "zero input: stopping list"))
    ;;OLD((number? inpt) (cons inpt applist) (display (applist))(inputlist))
    ((number? inpt) (append (applist)(list inpt)) (display (applist))(inputlist))
    (else 
    display "Not a number")))))
  </code></pre>
  
  <p>I understand why cons is not doing what I need it to be doing, but is there a similar functionality to appending each read in element to a pre-existing list?</p>
  
  <p>EDIT: I've gotten closer what i've needed to do but still with the same results, i am now appending upon my applist with a list i create via every input, though it is still resulting in as many empty lists as I input.</p>
  
  <p>SECOND EDIT: I've realized why it's printing multiple ()'s is because it's being called off the stack when 0 is entered, so i'm sure it's not working because the appending isn't working as intended, i've displayed the applist on the 0 conditional and it returns one null list.</p>