On Sun, 13 Sep 2009, Abdulaziz Ghuloum wrote: > I think one-pass gives you an approximation of let*-scoping > semantics while two-pass gives you recursive bindings. For > example, the following expression > > (let-syntax ((f (syntax-rules () ((_) 1)))) > (let () > (define (g) (f)) > (define (f) 2) > (g))) > > evaluates to 1 in one-pass since at the time (f) is expanded, > only the outer f is known. In two-pass, it evaluates to 2 > since (f) is expanded after the shadowing definition of f is > found.
No, I think that kind of thing should be required to be an error in 1-pass, since it would break the usual lexical scope. R5RS is one-pass (I think) and says this kind of thing is an error when you redefine DEFINE or BEGIN, but if one-pass is to be used, I think that should be generalized to include the above kind of case as well. This generalization was included in R6RS, which says anything that has already been used during expansion of the same body scope cannot be redefined later. In case of 1-pass, that rule invoked here would require an error. Andre _______________________________________________ r6rs-discuss mailing list [email protected] http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss
