[PRL] disallowing shadowing
Dave Herman
dherman at ccs.neu.edu
Sun May 29 16:05:20 EDT 2005
In lambda calculus you can always rebind an already-bound name, but in
practice, there are lots of limitations imposed on rebinding in real
languages: top-level module bindings can't be redefined in mzscheme,
operations of type classes can't be redefined at the top level in
Haskell, etc. What happens if you take this to the extreme and disallow
shadowing entirely in a lexically scoped language? [1]
At first I thought this would cause problems for macros, but in a
hygienic system that renames everything to something fresh anyway, it
probably wouldn't matter.
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?
Dave
[1] http://www.mail-archive.com/haskell@haskell.org/msg01268.html
More information about the PRL
mailing list