title: Conditional definitions in scheme (lisp)
body: <pre><code>(define (smallest x y z)
    (define min x)
    (cond ((&lt; y min) (define min y))
          ((&lt; z min) (define min z))
          (se (define min x)))
    min)
  </code></pre>
  
  <p>I'm trying to create a short procedure which returns the smallest of three numbers. It seems like the expression in a conditional can't be a definition, because I'm getting this error:</p>
  
  <pre><code> begin (possibly implicit): no expression after a sequence of internal definitions in:
    (begin (define min y))
    (define min y)
  </code></pre>
  
  <p>Do you have any suggestions on what I'm in fact doing wrong, is the problem using a definition for the expression portion?  If that's so, how would you tackle the problem?  Thanks in advance!</p>