Lauri Alanko wrote:
There is a question of how this should be translated. If we have:

(let ()
  (define a (foo))
  (define b (bar))
  (baz)
  (define c (quux))
  (quuux))

Then should it be translated as

(let ()
  (letrec* ((a (foo))
            (b (bar)))
    (baz)
    (letrec* ((c (quux)))
      (quuux))))

or

(let ()
  (letrec* ((a (foo))
            (b (bar))
            (dummy (baz))
            (c (quux)))
    (quuux)))

The latter.  That matches the 5.92 specification for top=level
bodies, and I think it's the Right Thing.

The first way would allow redefining the same variable multiple times
in a body, but I'd prefer the latter alternative, so that all
expressions and definitions directly inside a body use the same
scope. Moreover, I think that a definition should be allowed as the
final element of a body. The body of the resulting letrec* expression
would then be (unspecified).

I agree.
--
        --Per Bothner
[EMAIL PROTECTED]   http://per.bothner.com/

_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss

Reply via email to