no continuations

Ashley Yakeley ashley at
Fri Jan 9 00:48:15 EST 2004

In article <20040102051625.053B1AB8D at>,
 oleg at wrote:

> Similarly, R5RS obligates any Scheme implementation to resort to
> assignments when processing a letrec form.

Not mine! I do use a polyvariadic fixed-point function.

  (define circular (letrec ((c (cons 'x c))) c))

  (list-head circular 10)


  (x x x x x x x x x x)

Try it yourself at <>.
I also make the fixed-point function available as "call-with-result", 
it's more or less equivalent to this:

  (lambda (f) (letrec ((x (f x))) x))

> An implementation may not
> use a (polyvariadic) Y to implement letrec, unless the implementation
> can prove that the difference is unobservable for the form in
> question.

Do you have an example of use of Y for letrec where a program would 
violate R5RS?

Ashley Yakeley, Seattle WA

More information about the Haskell-Cafe mailing list