On 26 August 2013 14:34, Camille Teruel <[email protected]> wrote:
> > On 26 août 2013, at 13:31, Igor Stasenko wrote: > > the intent was to replace > Smalltalk at: > Smalltalk globals at: > > idioms with shorter one, and get rid of referencing Smalltalk global. > > The are not for solving future problems with introduction of environments. > > > We want to get rid of Smalltalk globals because it currently resolve to an > instance of SmalltalkImage, a class that does way too much things, > including holding the currently unique environment, while a global could > directly refer to it. > > Also the references to Smalltalk globals that where really wrong are > already gone and were in compiler. > > And even if you introduce them, i still think you need a way to refer to > globals (they are likely to stay) > > > Globals are global to their environment. We could also call them > environment variable. > > Nope. In current system it is something else. It is a global variable not local to any environment. And you will certainly have problems with old (and not so) code, if you swap the meaning (and underlying semantic) of globals to anything else you may want. This is what i trying to point out. In this case, #asClass is good, because it makes sure that old semantics will be preserved, no matter what changes we may do. It also will allow us to revisit all senders of #asClass and easily change them to something else when we will be ready for that.. and btw it will be much easier comparing to visiting all uses of Smalltalk or all uses of ThisEnvironment.
