On Sun, 24 Apr 2011, Aaron W. Hsu wrote: > On Sun, 24 Apr 2011 15:50:15 -0400, Andre van Tonder <[email protected]> > wrote: > >> On Sun, 24 Apr 2011, Aaron W. Hsu wrote: >> >>> On Sun, 24 Apr 2011 15:34:23 -0400, Andre van Tonder <[email protected]> >>> wrote: >>> >>>> The latter behaviour may be compatible with the document in systems in >>>> which all identifiers are considered implicitly bound at toplevel, so the >>>> DEFINE would be like a SET! >>> >>> Even in systems where this is the case, and Chez in particular, this does >>> not do this. >> >> I thinkthe reason Chez does not doi this is becasue you are replacing a >> syntactic binding for ELSE by a variable binding, so the DEFINE is not like >> a SET!. IF the original binding of ELSE was a variable binding, the >> define would be like a SET! and the ELSE clause would match. > > It does not matter whether the else is a syntactic binding or a variable > binding. Chez behaves the same in either case regarding this. Take this for > example: > >> (library (a) > (export test else) > (import (except (chezscheme) else)) > (define-syntax test > (syntax-rules (else) > [(_ else) 'else] [(_ blah) #f])) > (define else #f)) >> (import (a)) >> (test else) > else >> (test x) > #f >> (define else #t) >> (test else) > #f >> > > The definition actually alters the lexical binding; library exports are > immutable, and thus a redefinition is more like a shadowing than a set!.
I agree with your example, but I was referring to the case where everything was at the top-level (no modules involved), where the behaviour is different. _______________________________________________ Scheme-reports mailing list [email protected] http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports
