[plt-scheme] shadowing initial imports (3.99.0.20)

From: Doug Orleans (dougorleans at gmail.com)
Date: Sun Mar 23 18:49:12 EDT 2008

Matthew Flatt writes:
 > Version 3.99.0.20 implements Jos's suggestion:
 > 
 >  http://list.cs.brown.edu/pipermail/plt-scheme/2008-February/023282.html
 > 
 > 
 > This change means, for example, that you can write
 > 
 >   #lang scheme
 >   (require srfi/1)
 > 
 > in which case the body of the module uses `map', `third', and several
 > other names from `srfi/1' instead of from `scheme'.
 > 
 > This shadowing rule applies only to the initial import (a.k.a.
 > "language" of the module). For example,
 > 
 >   #lang scheme
 >   (require scheme srfi/1)
 > 
 > still reports a syntax error, since `scheme' is (also) `require'd in
 > the module body, and `scheme' and `srfi/1' provide many of the same
 > names with different bindings.

I think this is a good idea-- it's a partial form of something I
suggested a couple years ago:

http://list.cs.brown.edu/pipermail/plt-scheme/2006-May/012939.html
http://list.cs.brown.edu/pipermail/plt-scheme/2006-May/012943.html

(This specific part, module language having least precedence, is
mentioned at the end of the second message.)  What do you think of the
rest of my suggestion?  That is: local bindings should be able to
override imported bindings, and explicitly imported bindings should be
able to override implicitly imported bindings.

--dougorleans at gmail.com


Posted on the users mailing list.