On Sep 14, 2009, at 12:22 PM, Brian Harvey wrote:

> (Also of course, what's most important isn't that R7RS say "there  
> must be
> a REPL," but rather that it refrain from specifying semantic  
> constraints
> ("two-pass", e.g.) that are difficult or impossible to provide in a  
> REPL.
> And let's not go back to the bad old days when compiled Lisp had  
> different
> semantics (lexical scope) from interpreted Lisp (dynamic scope).)


Some R5RS Schemes provide two-pass semantics when forms entered at the  
REPL are wrapped in a `begin':

(begin (define foo (bar)) (define-syntax bar (syntax-rules () ((_)  
1))) foo)

-> 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.

I believe that this approach is sensible. It treats `begin' as a  
binding form in all contexts, with unified semantics in each  
situation. This only leaves open the question of how to treat `load'ed  
files / R6RS-style top-level programs: as wrapped in an implicit  
`begin', or a sequence of forms as if entered at the REPL?

--
Brian Mastenbrook
[email protected]
http://brian.mastenbrook.net/


_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss

Reply via email to