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

Per Bothner per at bothner.com
Mon Jan 22 13:54:36 EST 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/



More information about the r6rs-discuss mailing list