Efficient thread-local shared variables

Reinout Heeck reinz at desk.org
Tue Oct 24 17:03:23 UTC 2006


On Oct 24, 2006, at 6:07 PM, ncellier at ifrance.com wrote:

> Yes, despite very confusing names i used, you understood me well,  
> "key" was to be replaced with any variable name lying in the pool  
> dictionary.


Ah, I needed that extra bit of explanation.

I don't implement setters on my Vocabulary object (don't need them)  
only getters. Setting is done by manipulating the MethodDictionary  
through the anonymous class in my system. So the sharing of a  
reference between setter and getter is a non-issue for me.


>>> key
>>>   ^(literalAt: 1) value
>>>
>>> key: aValue
>>>   ^(literalAt: 1) value: aValue

Your code suggests that literal slots hold valueholders, this is not  
the case (at least in VW).


Since I don't use setters it is possible to have an entry with a key  
that ends in a colon like #key: (I can use any arbitrary object as  
selector/key in VW).

Searching for that entry would look like

   ^aVocabulary perform: #key:

Note the missing #withArguments:, all my entries are looked up by  
#performing a zero-arg method, even if the key suggests otherwise.
Put differently: all the methods are zero-arg, just returning their  
first literal.
As selector I can use *any* object including confusing Symbols that  
suggest arguments...



R
-





More information about the Squeak-dev mailing list