[plt-scheme] redefinition in module
No I dont want a module to contradict itself.
That would be like (letrec ((a 1) (a 2)) whatever) which is not allowed. That's perfectly allright for me. I would not want it to be allowed.
A module is not top-level, it is module top level, quite another species.
Jos
----- Original Message -----
From: Matthias Felleisen
To: Jos Koot
Cc: plt-scheme at list.cs.brown.edu
Sent: Friday, February 29, 2008 8:10 PM
Subject: Re: [plt-scheme] redefinition in module
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/0b944392/attachment.html>