title: Unbound Variables in Scheme
body: <pre><code>(define input (read-line))
  (define lngth (string-length input))
  (define first-char (string-ref input 0))
  (define test-num 
    (string-&gt;number 
     (substring input 0 (- (string-search-forward " " input) 1))))
  (define end (string-search-forward ")" input))
  (define beginning (string-search-backward "(" input))
  (define operation (string (substring input beginning (+ end 1))))
  (define space1 (string-search-forward " " operation))
  (define space2 (string-search-backward " " operation))
  (define n1 (string-&gt;number (substring operation 1 space1)))
  (define n2 (string-&gt;number (substring operation (+ space1 1) space2)))
  (define result (1))
  (define operator (substring operation (+ space2 1) end))
  
  (if (or (equal? first-char #\() (number? test-num))
      (display "yay")
      (display "ERROR"))
  </code></pre>
  
  <p>I'm using this with MIT/GNU Scheme implementation, which lets me run this code and responds correctly. My problem though is that once user data is put into the function it doesn't bind any sort of information to the variables. I.E. after putting in data and trying to access any of the parameters I get the following:</p>
  
  <pre><code>1 ]=&gt; (display input)
  ;Unbound variable : input
  </code></pre>