[racket] internal define

From: Dmitry Pavlov (dpavlov at ipa.nw.ru)
Date: Fri Nov 30 12:03:12 EST 2012

Hello,

I have been forcing myself to use (define) over (let),
following the guide:
http://www.ccs.neu.edu/home/matthias/Style/style/Choosing_the_Right_Construct.html#(part._.Definitions)

So I have come across this strange behavior:

(define (test x)
     (display x)
     (define x 2)
     (display x))
 > (test 1)
#<undefined>2

while the analogous construct with (let) works as expected:

(define (test1 x)
     (display x)
     (let ((x 2))
       (display x)))
 > (test1 1)
12

Is there a list of what one can do and what one can not
do with internal define?

Best regards,

Dmitry

Posted on the users mailing list.