[plt-scheme] redefinition in module

From: Jos Koot (jos.koot at telefonica.net)
Date: Fri Feb 29 14:04:20 EST 2008

#lang scheme (let ((add1 sub1)) (add1 3))
is perfecttly alright.

#lang scheme (define add1 sub1) (add1 3)
is not accepted.

Why?
The redefinition does no harm to any other imported procedure or macro.
That's the beauty of modules: being sure that your macros and procedures cannot be corrupted by invoking modules.
The restriction forces me to rename procedures and syntaxes previously not present, but now provided by #lang scheme.
For example, I had my own nice and more general version of syntax 'for'. I no longer can import my own 'for' without renaming.
And I have to rename every invocation of my for in all modules requiring my nice 'for'.
I think that redefinitions in a module must be allowed and must be considered to be local to the module.

Now what happens:
1: You have a fine #lang scheme program.
2: You download a new scheme whose #lang scheme happens to include a 'new' procedure or syntax with the same name as used in your nice program.
3: Or one of the required modules happens to do that.
4: The program no longer can be compiled.

Why? This is very much against the principle of scope, I think.
I cannot think of any implementation problem.

Jos Koot.





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20080229/84f344ab/attachment.html>

Posted on the users mailing list.