Stef,
In PocketSmalltalk globals are replaced by class variables in Object... But, in PocketSmalltalk there is a set of things done behind the scene developpers don't seem to have access to them.
Now, if we make the decision to remove gloabals we need to bootstrap the system somehow. Eg. how will we kow that Smalltalk refers to the global system dictionary?
Actually, I didn't think a lot about it. But, I have the feeling that we still need globals but need some extra scoping hierarachical mechanism: a kind of namespaces where the root namespace would named... Smalltalk...
Noury
stéphane ducasse wrote:
Hi
I wanted to get feedback about the idea of removing global variables in Smalltalk. The fact that system dictionary or a namespace can contain variable ie (a binding to something else than a class) makes the code quite ugly since we have to always test if this is a class or not.
I think that we could easily remove the possibility to have global variable and move the ones we have into classVariable of Smalltalk or appropriate classes. This would lead to a more modular system.
Smalltalk keysAndValuesDo: [:k :v | v isBehavior ifFalse: [Transcript show: k ; cr]]
ImageImports Display ScheduledControllers ScriptingSystem Smalltalk CustomEventsRegistry World SystemOrganization References ActiveHand Transcript Undeclared SourceFiles Processor ActiveWorld TextConstants Sensor ActiveEvent
Now we would have to type Smalltalk transcript instead of Transcript.
Any thoughts.
Stef
PS: Backward compatibility is not a reason since we are about inventing the future not the past