On Wed, Sep 23, 2015 at 7:38 PM, Kaushik Ghose <kaushik.gh...@gmail.com>
wrote:

> I haven't gotten to cond yet.


Ok. Yeah, if- branches aren't allowed to have definitions, or even
sequences of operations. You can get around this with begin:

(define (f x)
  (if (even? x)
      (/ x 2)
      (begin
        (define a (* x 2))
        (define b (* x 3))
        (f (+ a b)))))

--

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to