In the paper Fixing Letrec: A Faithful Yet Efficient Implementation of Scheme’s Recursive Binding Construct by Dybvig et al. it is said that (emphasis mine):
A theoretical solution to these problems is to restrict
letrec
so that its left-hand sides are unassigned and right-hand sides arelambda
expressions. We refer to this form ofletrec
asfix
, since it amounts to a generalized form of fixpoint operator. The compiler can handlefix
expressions efficiently, and there can be no violations of theletrec
restriction withfix
. Unfortunately, restrictingletrec
in this manner is not an option for the implementor and would in any case reduce the generality and convenience of the construct.
I have not scrutinized the R5RS report, but I have used letrec
and the equivalent "named let
" in Scheme programs and the unfortunate consequences mentioned in the paper are not clear to me, can someone enlighten me ?