[Pharo-dev] Another thought about globals

Norbert Hartl norbert at hartl.name
Sun Dec 15 05:22:38 EST 2013

Am 14.12.2013 um 21:08 schrieb Stéphane Ducasse <stephane.ducasse at inria.fr>:

>> Hi Norbert--
>>> Class names are globals. A class is registered in a global namespace
>>> by its name. Names need to be looked up. How should it work in
>>> another way?
>>    Get rid of globals. Make the root classes elements of the special
>> objects array (Object already is), and look up classes through that.
>> Make everything else that used to be a global (like Transcript) the
>> responsibility of some class, and use them by sending messages. This
>> also makes the modularization straightforward.
> This is what we did with 
>    Smalltalk -> self environment.
>    Smalltalk -> SmalltalkImage current
> Now I wonder if it really solves the problem that has igor (this is true that I would prefer to avoid to 
> have specific declaration. 
> Now what would be good is to have a protocol to systematically initialize such "global" even when they 
> are attached to classes.
What speaks against Package>>#initialize ? Or package having a selector returning the list of package wide globals and a selector for each global to create the value for it?
What is the difference between a dependency to a package and the access to its globals? Shouldn't the package not having defined its dependencies and couldn't that mean the same information composes the "global" namespace for this package? 

>>    There's no need for a system dictionary. It was a profound and
>> long-lived mistake.
> In the midterm I want to get rid of it (by splitting it and distributing into module) but it will take 
> time. 

More information about the Pharo-dev mailing list