>>33
Internal definitions are syntactic sugar for letrec
in R5RS and letrec*
in R6RS and R7RS-small. In the latter case, the order of evaluations is specified to go from left-to-right. Only your first example is mutually recursive, in which case the order does not matter. This is because letrec
first creates fresh locations, which are captured by the closures during their evaluations. Once evaluated, they are assigned to the location, mutating the captured environment. If portability was the goal, the second example should have used let*
and the third let
.