[ANN] Process-Specific Variables
Andreas Raab
andreas.raab at gmx.de
Tue Mar 13 19:33:41 UTC 2007
I haven't looked at the code so I'm guessing but from the description it
sounds as if you'd be doing something like:
ProcessLocalVariable subclass: #MyGlobalVar
and then something like:
MyGlobalVar value. "retrieve its value"
MyGlobalVar value: aValue. "set the value"
except that the value of the variable is only valid in the scope of the
current process.
The idea of having a "class per variable" is actually intriguing to me -
I had never thought of it that way but it makes for some interesting
implications. And with a trivial modification to the compiler would
allow you to do something like, e.g.,
MyGlobalVar. "retrieve value"
MyGlobalVar := aValue. "set the value"
Cheers,
- Andreas
Sebastian Sastre wrote:
> Martin,
>
> I'm sure you are able to think about the aplicability of
> Process-Specific Variables. Can you elaborate some examples? I'm pretty sure
> I'm not the only one that is not up to date with that and I think it will
> help to understand the practical consequences of using them facilitating the
> ponderation of it's value.
>
> thanks,
>
> Sebastian Sastre
>
>> -----Mensaje original-----
>> De: squeak-dev-bounces at lists.squeakfoundation.org
>> [mailto:squeak-dev-bounces at lists.squeakfoundation.org] En
>> nombre de "Martin v. Löwis"
>> Enviado el: Martes, 13 de Marzo de 2007 16:03
>> Para: squeak-dev at lists.squeakfoundation.org
>> Asunto: [ANN] Process-Specific Variables
>>
>> I'd like to announce the first release of Process-Specific
>> Variables, from
>>
>> http://www.squeaksource.com/ProcessLocalStorage.html
>>
>> Process-specific variables are variables that are neither
>> global nor specific to an object (like instance variables) or
>> to a class.
>> Instead, they can have a different value in the context of
>> each Process.
>>
>> New variables are declared by inheriting from a base class,
>> similar to the way WADynamicVariable of Seaside works.
>>
>> There are two kinds of process-specific variables:
>> - ProcessLocalVariable is the base class for process-specific
>> read-write variables. They are similar to thread-local storage
>> (TLS) available in various operating systems. Reading and writing
>> uses #value and #value:
>> - DynamicVariable is the base class of dynamically-scoped read-only
>> variables. They are similar to the dynamic scoping in LISP.
>> They can be read using #value, and set for the duration of a block
>> with #value:during:
>>
>> The implementation uses a per-process dictionary which is
>> keyed by the variable class.
>>
>> Comments are welcome,
>>
>> Martin
>>
>>
>
>
>
More information about the Squeak-dev
mailing list
|