[r6rs-discuss] [Formal] Relax ordering constraint on library bodies

From: Per Bothner <per>
Date: Mon Jan 22 13:55:00 2007

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

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:01 UTC