title: implementing bst in racket
body: <p>I am trying to implement a bst(binary search tree) in racket. The bst is a recursive list 
  (list x leftChild rightChild) where leftChild and rightChild are lists themselves
  I wrote the following code</p>
  
  <pre><code>(define (insert bst x)(
       (cond 
         [(null? bst) (append bst (list x '() '()))]
         [(&lt;= x (car bst)) (insert (cadr bst) x)]
         [else (insert (caddr bst) x)]  
       )))
  </code></pre>
  
  <p>when I write </p>
  
  <pre><code>(insert (insert null 8) 9)
  </code></pre>
  
  <p>it gives an error: <strong>function call: expected a function after the open parenthesis, but received (list 8 empty empty)</strong>
  Can anyone explain this? </p>