On Mon, Feb 23, 2009 at 1:13 PM, Per Bothner <[email protected]> wrote:
>
> When compiling a module, that means deferring lambda expansion
> until the end of the module - or until it is needed for a syntax
> expansion (though that gets a little tricky).
I think it's more than a little tricky. In particular, this program
changes in behavior depending on whether the bodies of lambdas are
expanded lazily or eagerly:
(import (rnrs))
(define-syntax m
(lambda (stx)
(if (read (open-input-file "/tmp/x")) #'1 #'2)))
(define f (lambda (s)
(let-syntax ([g (lambda (stx)
(put-datum (transcoded-port
(open-file-output-port "/tmp/x" (file-options no-fail))
(native-transcoder))
#f)
#''nothing)])
(g))))
(display (m))
So either we mandate eager expansion, or we mandate lazy expansion, or
programs that use side effects at expansion time are non-portable.
--
sam th
[email protected]
_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss