>>>
>>> Is this now used in Squeak? Is it worth the complexity?
>>
>> Squeak doesn't use ReadOnlyVariableBinding anymore. The bindings of
>> classes are instances of the ClassBinding class.
>> Without using separate class it's a bit cumbersome (and less OO) to decide
>> if an assignment to a global variable should be allowed or not. E.g.:
>>
>> Foo := 1.
>>
>> should work if Foo is a global, but not a behavior. It should raise an
>> error if it's a behavior.
>
> I have mixed feelings about that. In most Smalltalks one can write something
> like the following and expect it to work.
>
> | original |
> original := SomeClass.
> [SomeClass := SomeReplacementClass.
> ... some code involving SomeClass (typically a passed in Block) ...
> ] ensure: [SomeClass := original]
>
> That is, the name of the thing is not the thing itself.
>
> Of course, as long as one could write /Smalltalk at: #SomeClass put:
> SomeReplacementClass/, it would still be possible to achieve the same
> effect. (And of course, "Smalltalk" could be any namespace.)
>
I think the original idea was to make the system more resilient for end-user
Scripting. To make sure people do not do by accident
True := nil.
Marcus