[PRL] disallowing shadowing

Felix S Klock II pnkfelix at ccs.neu.edu
Sun May 29 17:02:20 EDT 2005


On May 29, 2005, at 4:05 PM, Dave Herman wrote:
> Other than being an annoyance when you want to reuse a name for  
> some other purpose (which is arguably bad style anyway), what  
> problems would disallowing local rebinding cause?

Every fragment of my program is going to affect what changes I can  
make to its outer context.  This means that every time I want to  
introduce a new global name, rather than merely inspecting the  
current list of global names, I'll have to inspect the entire program  
text to ensure that there are no collisions.

I don't know what you're classifying as an annoyance.  If you never  
make changes to your context, and instead are always working from the  
outside-in (perhaps better known as top-down programming?), then  
maybe you won't care about this.

Look, how about this way of looking at things: you know that systems  
programming language, what's it called . . . C?  It has a pretty  
restrictive set of rules for what you name procedures.  You should  
try programming in that for a while and let us know how it turns out.

-Felix




More information about the PRL mailing list