[Style] added warning about define vs let star; see mailing list

This commit is contained in:
Matthias Felleisen 2012-12-26 21:52:02 -05:00 committed by Eli Barzilay
parent 4c8cba8104
commit aff9862c52

View File

@ -72,6 +72,37 @@ racket
]
]
@bold{Warning} A @racket[let*] binding block is not easily replaced with a
series of @racket[define]s because the former has @emph{sequential} scope
and the latter has @emph{mutually recursive} scope.
@compare[
@racketmod[#:file
@tt{works}
racket
(define (print-two f)
(let* ([_ (print (first f))]
[f (rest f)]
[_ (print (first f))]
[f (rest f)])
(code:comment "IN")
f))
]
@; -----------------------------------------------------------------------------
@racketmod[#:file
@tt{does @bold{not}}
racket
(define (print-two f)
(print (first f))
(define f (rest f))
(print (first f))
(define f (rest f))
(code:comment "IN")
f)
]
]
@; -----------------------------------------------------------------------------
@section{Conditionals}