[plt-scheme] redefinition in module

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Fri Feb 29 14:10:50 EST 2008

Would you also want

;; ---
#lang scheme
(define add1 sub1)
...
(define add1 zero?)
...
;; ---

to work? If not, I could see myself agreeing with you. -- Matthias



On Feb 29, 2008, at 2:04 PM, Jos Koot wrote:

> #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.
>
>
>
>
>
>
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
> --===============1036147421==--

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

Posted on the users mailing list.