Could you post the "ugly" code? I'm curious because things like this compile fine:
(define (f-recur x y) (cond ((< x 1) 10) (else (define z 3) (f-recur x y)))) On Wed, Sep 23, 2015 at 7:25 PM, Kaushik Ghose <kaushik.gh...@gmail.com> wrote: > > On Wed, Sep 23, 2015 at 12:26 PM, Pierpaolo Bernardi <olopie...@gmail.com> >> wrote: >> >>> On Wed, Sep 23, 2015 at 6:18 PM, Kaushik Ghose <kaushik.gh...@gmail.com> >>> wrote: >>> >>> > Can I have any statements in this block that I could have in a (define >>> ...) >>> > block? Can I have (defines ) for example? >>> >>> Yes, and yes :) >>> >> >> Hmm. I get a "define: not allowed in an expression context" when I try to > do that. I did manage to use nested let* and let-values to achieve my goal, > though it looks pretty ugly. > > -- > 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. > -- 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.