On Sep 10, Brian Harvey wrote:
>
> I'm not worried that my favorite Scheme will suddenly stop having a
> repl altogether. I'm worried that it will suddenly not allow
> redefinition (in the sense we've always had) because its
> implementors will lean toward making the efficiency of compiled code
> more important than the sensibleness of the repl. I want the
> standard to be crystal clear that the semantics of the repl are not
> up for grabs.
> [...]
> I think it's fine if Toaster Scheme doesn't have a repl at all. But
> if there /is/ a repl, then I want it to behave properly. I want the
> standard to ensure that my repl behaves properly for the same reason
> that you want modules, or macros, or whatever it is that you care
> about, to work properly.
On Sep 10, Brian Harvey wrote:
> [...]
> I'm confused. Isn't this the problem that modules are supposed to
> solve? Typically it would only be the code that the user typed in
> herself that would need recompilation.
>
> But I only said "it makes me sad," not "fix this"! :-)
This "redefinitions as we've always had" issue is similar to the
defmacro thing... Without a module system that forbids mutation of
bindings, you get a disaster where it's impossible to have anything
like an IDE, an IRC bot, a system to evaluate student homeworks, and
any large project that involves more than a single developer becomes
extremely fragile. It's enough that one developer redefines `+' in a
way that the other didn't expect and the whole thing goes up in
flames.
The popular way of (let ((car car) (cdr cdr)) ...code...) is a
horrible mess because you're doing something very similar to what a
module system is doing -- except that you're doing it manually, and
you need to wrap each and every definition. The bottom line is that
this is very far from what I'd call "jewel-like".
OTOH, a module system like PLT's there is simply no need for such
redefinition-by-mutation. All I need to do to redefine `+', for
example, is:
#lang scheme
(provide (except-out (all-from-out scheme) +)
(rename-out [add +]))
(define (add x . xs)
(apply (cond [(number? x) +]
[(list? x) append]
[(string? x) string-append]
;; ...
)
x xs))
This gives me a language module -- and in this language `+' is bound
to the above function, and there is no problems getting the code
compiled (with inlining etc), and no problems with student code
crashing my testing script. IMO, *that* is much more jewel-like.
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://barzilay.org/ Maze is Life!
_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss