On Sep 14, 2009, at 8:40 PM, Brian Mastenbrook <[email protected]> wrote:
> For those who are not using macros (or using them in non-"screwy" > ways), the *only* change that this causes is that: > > (begin > (define a 1) > (define a 2) > a) -> error, duplicate binding of `a' in `begin' > > And isn't it nice that your implementation will detect when you try to > define the same variable twice in the same `begin' form at the REPL? > This is the same error you'd get if you'd tried to do this in a > `lambda' form too. Well, that's not actually true. You'll see a difference also in: (define b 1) (begin (define a b) (define b 2)) -> error, attempt to use `b' before its definition Once again, what was really meant here? I believe all such behavioral differences come down to the use of `define' at the top level to mean `set!'. If you always write `set!' when you mean to mutate an existing binding, you won't see a difference. -- Brian Mastenbrook [email protected] http://brian.mastenbrook.net/ (If this comes out in MIME oddness, blame my iPod touch.) _______________________________________________ r6rs-discuss mailing list [email protected] http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss
