Hi, i'm using MzScheme, with my code:<br><br>(define (partition n)<br> (define results (make-vector (+ n 1)))<br> (define (update cur max val)<br> (vector-set! (vector-ref results cur) max val)<br> val)
<br> <br> (let loop ((i 0))<br> (cond ((> i n) 0)<br> (else (vector-set! results i (make-vector (+ n 1) 0))<br> (loop (+ i 1)))))<br> <br> (define (part cur max)<br>
(cond ((= cur 0) 1)<br> ((not (= (vector-ref (vector-ref results cur) max) 0))<br> (vector-ref (vector-ref results cur) max))<br> (else (update cur max (let loop ((i 1))
<br> (cond ((or (> i max) (> i cur)) 0)<br> (else (+ (part (- cur i) i)<br> (loop (+ i 1)))))))))))<br><br>I receive the error "define: not allowed in an expression context in: (define (part cur max) (cond ((= cur 0) 1) ((not (= (vector-ref (vector-ref results cur) max) 0))...", why can't I put a define in a define after a let statement?
<br>