{- Side topic ... what Racket construct corresponds to Haskell's let expression? Answer: letrec! Not let, and not let*. All of the variables being defined in the let are visible when evaluating the expressions that define then. The straightforward cases are when some variables depend on other variables (without any cyclic dependencies) and for recursive functions. However, it does works in some other cases since Haskell uses lazy evaluation. In any event, it makes Racket's let* unnecessary. -} -- Example of a recursive function defined in a let. Notice that the -- name factorial is visible in the expression that defines it. f10 = let factorial n = if n==0 then 1 else n*factorial (n-1) in factorial 10 -- This gets into an infinite loop if you try to use the value of z (but -- typechecks correctly, and is harmless if you don't try to use it) z = let x = 0*x in x -- But this works! Notice that the parameter s is shadowed by the s -- in the let (even in the expression that defines s) strange s = let s = const "squid" s in s -- this works as well ones = let xs = 1 : xs in xs