A fully late bound namespace proposal

Andreas Raab andreas.raab at gmx.de
Thu Oct 4 14:55:00 UTC 2007


Forgot to point out how to trivially implement that proposal:

* Change ROVB>>isSpecialReadBinding to return true (this will send #value)

* Implement ROVB>>value as:
ROVB>>value
   ^value ifNil:[Smalltalk at: key ifAbsent:[nil]]

* Recompile the entire system (to use ROVB>>value)

* Go through the class names in Smalltalk and nil out their values:

   Smalltalk associationsDo:[:bndg| bndg value isBehavior ifTrue:[
     [bndg value: nil]
         on: AttemptToWriteReadOnlyGlobal
         do:[:ex| ex resume: true].
   ]].

Cheers,
   - Andreas

Andreas Raab wrote:
> Göran Krampe wrote:
>> One way to do this is to compile a global ref as a message send so that:
>>
>>    Array
>>
>> ...compiles *as if* it said:
>>
>>    Smalltalk resolve: #Array
>>
>> ...or something similar. Then we can actually dynamically figure out 
>> if it
>> should evaluate to "good old Array" or "Jim's new cooler Array" depending
>> on for example the PI of the sender or any current remappings or 
>> whatever!
> 
> This is trivial to do but unfortunately it doesn't solve *any* real 
> problems. But it creates new ones: For example, access to classes would 
> suddenly be slowed down by 100x or more and you'd have to be very 
> careful where and how you use classes (no use in tight loops for 
> example) then creating new kinds of references (in iVars etc) that the 
> compilers don't know about and can't fix when recompiling stuff.
> 
> This has always been my problem with these late bound proposals: They 
> sound nice, but they do not solve any actual problem that their 
> proponents can point to, and everyone will be paying the price for a 
> horribly slow lookup of classes. Bad tradeoffs.
> 
> Cheers,
>   - Andreas
> 
> 




More information about the Squeak-dev mailing list