[FIX] ClassVarsFix-petervr (was: Shared variables binding/lookupbug)

Tim Rowledge tim at sumeru.stanford.edu
Sun Oct 12 00:53:26 UTC 2003


Anthony Hannan <ajh18 at cornell.edu> wrote:

> "Peter van Rooijen" <squeak at vanrooijen.com> wrote:
> > From: "Anthony Hannan" <ajh18 at cornell.edu>
> > > but he also changed Class>>declare: to no longer raise a notifier
> > > when filing-in a class var that shadows another var.
> > 
> > Defining a class variable that shadows another var is neither an error nor
> > something that needs to be debugged, so I don't see the reason for sending
> > self error:, *at all*.
> 
> I would still like to see a notifier because I don't think it is not
> good style to shadow a global var.

I'd go further; not only is it not good style, it is decidedly
dangerous to the understandability of the system. Worse yet it makes a
possibility that two bits of code that look very similar can refer to
quite different variables. Even worse, the time-order of compiling
methods could result in some refering to the global and some to the
classvariable.

All in all, a terribly bad thing.

tim
--
Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
Useful random insult:- If she was any dumber, she'd be a green plant.



More information about the Squeak-dev mailing list