title: Racket: Trying to subtract numbers, getting list
body: <p>I'm currently learning Racket/Scheme for a course (I'm not sure what's the difference, actually, and I'm not sure if the course covered that). I'm trying a basic example, implementing the Newton method to find a square root of a number; however, I ran into a problem with finding the distance between two numbers.</p>
  <p>It seems that for whatever reason, when I'm trying to apply the subtraction operator between two numbers, it returns a list instead.</p>
  <pre class="lang-lisp prettyprint-override"><code> #lang racket
  
  (define distance
      (lambda (x y) (
              (print (real? x))
              (print (real? y))
              (abs (- x y))
          )
      )
  )
  
  (define abs
      (lambda x (
          (print (list? x))
          (if (&lt; x 0) (- x) x)
          )
      )
  )
  
  (distance 2 5)
  </code></pre>
  <p>As you can see, I've added printing of the types of variables to make sure the problem is what I think it is, and the output of all those prints is <code>#t</code>. So:</p>
  <ul>
  <li>In calling distance, x and y are both real.</li>
  <li>In calling abs, x is a list.</li>
  <li>So, the conclusion is that (- x y) returns a list, but why?</li>
  </ul>
  <p>I double-checked with the documentation and it seems I'm using the subtraction operator correctly; I've typed <code>(- 2 5)</code> and then <code>(real? (- 2 5))</code> into the <strong>same</strong> REPL I'm using to debug my program (Dr. Racket, to be specific), and I'm getting the expected results (<code>-3</code> and <code>#t</code>, respectively).</p>
  <p>Is there any wizard here that can tell me what kind of sorcery is this?</p>
  <p>Thanks in advance!</p>