John Cowan wrote:
> Per Bothner scripsit:
>
>>> Eliminating the distinction between library bodies and toplevel bodies
>>> also allows a simplification in both description and understanding.
>> Why not go further: relax ordering constraint on *all* bodies?
>
> Sounds good to me, provided the current semantics (all definitions are reordered
> before expressions) is maintained.
Huh? Any side-effects should be in the order as in the file, which
matches the existing specification at the end of section 8.
(define (f x)
(define y (use x))
(display y)
(define z (use x y))
(display z)
(use x y z))
becomes:
(define (f x)
(letrec* (
(y (use x))
(ignored1 (begin (display y) (unspecified)))
(z (use x y))
(ignored2 (begin (display z) (unspecified))))
(use x y z)))
--
--Per Bothner
per_at_bothner.com http://per.bothner.com/
Received on Mon Jan 22 2007 - 13:54:36 UTC