On Sep 14, 2009, at 2:17 PM, John Cowan wrote: > Brian Mastenbrook scripsit: > >> -> 1 in Scheme48, MIT and Gauche. It's an error in PLT (R5RS mode), >> Larceny (R5RS mode), Gambit (hygienic mode), Chez 7.4d, SISC, and >> Bigloo. > > Guile, Chicken 4, and Chibi all puke on it too, but Kawa returns 1.
Chicken pukes because it introduces a new scope when switching from `define' to `define-syntax'. > >> I believe that this approach is sensible. > > I don't agree. If that ought to work, why shouldn't (begin (define > foo > (bar)) (define (bar) 32)) work? Or for that matter (begin (define foo > bar) (define bar 32))? Both of those examples violate the semantics of `letrec'. The example I gave does not. > The informal semantics of "begin" is that things are done in left-to- > right > order. If you want parallel evaluation, you know where to find it. Absolutely not. The R5RS specifies that inner `define' forms are equivalent to a `letrec', which is most definitely *not* left-to- right. The R6RS added inner `define-syntax' to this, which necessitated a more formal specification of the behavior, and also did specify the behavior of ordinary `define's to be left-to-right. -- Brian Mastenbrook [email protected] http://brian.mastenbrook.net/ _______________________________________________ r6rs-discuss mailing list [email protected] http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss
