Re: [Pharo-dev] Context variables?

2014-10-17 Thread Frank Shearar
Bear in mind that if you do any fancy stack slicing, you will get...
*unexpected* behaviour from DynamicVariable. (See
http://www.lshift.net/blog/2012/06/27/resumable-exceptions-can-macro-express-delimited-dynamic-variables/
and follow-on links.)

frank

On 15 October 2014 16:34, Camille Teruel  wrote:
> Hi Jeff,
>
> I think you should look at DynamicVariable and ProcessSpecificVariable
> classes. The first one is a read-only while the second is writable.
> You have to subclass these class for each variable you want.
>
> Ex:
> DynamicVariable subclass: #MyVar.
> MyVar value: 4 during: [ MyVar value ]
>
> HTH,
> Camiile
>
>
> On 15 oct. 2014, at 17:09, J.F. Rick  wrote:
>
> I remember there was some discussion on the list about support for variables
> tied to the context rather than to the instance or class. This seems
> particularly useful for a web application where you might want to access the
> request and response from the context. What is the proper name for these
> kind of variables and where can I read about how to use them?
>
> Cheers,
>
> Jeff
>
> --
> Jochen "Jeff" Rick, Ph.D.
> http://www.je77.com/
> Skype ID: jochenrick
>
>



Re: [Pharo-dev] Context variables?

2014-10-16 Thread J.F. Rick
Thanks. Will do.

Jeff

On Wed, Oct 15, 2014 at 11:34 AM, Camille Teruel 
wrote:

> Hi Jeff,
>
> I think you should look at DynamicVariable and ProcessSpecificVariable
> classes. The first one is a read-only while the second is writable.
> You have to subclass these class for each variable you want.
>
> Ex:
> DynamicVariable subclass: #MyVar.
> MyVar value: 4 during: [ MyVar value ]
>
> HTH,
> Camiile
>
>
> On 15 oct. 2014, at 17:09, J.F. Rick  wrote:
>
> I remember there was some discussion on the list about support for
> variables tied to the context rather than to the instance or class. This
> seems particularly useful for a web application where you might want to
> access the request and response from the context. What is the proper name
> for these kind of variables and where can I read about how to use them?
>
> Cheers,
>
> Jeff
>
> --
> Jochen "Jeff" Rick, Ph.D.
> http://www.je77.com/
> Skype ID: jochenrick
>
>
>


-- 
Jochen "Jeff" Rick, Ph.D.
http://www.je77.com/
Skype ID: jochenrick


Re: [Pharo-dev] Context variables?

2014-10-15 Thread Camille Teruel
Hi Jeff,

I think you should look at DynamicVariable and ProcessSpecificVariable classes. 
The first one is a read-only while the second is writable.
You have to subclass these class for each variable you want.

Ex:
DynamicVariable subclass: #MyVar.
MyVar value: 4 during: [ MyVar value ]

HTH,
Camiile


On 15 oct. 2014, at 17:09, J.F. Rick  wrote:

> I remember there was some discussion on the list about support for variables 
> tied to the context rather than to the instance or class. This seems 
> particularly useful for a web application where you might want to access the 
> request and response from the context. What is the proper name for these kind 
> of variables and where can I read about how to use them?
> 
> Cheers,
> 
> Jeff
> 
> -- 
> Jochen "Jeff" Rick, Ph.D.
> http://www.je77.com/
> Skype ID: jochenrick



[Pharo-dev] Context variables?

2014-10-15 Thread J.F. Rick
I remember there was some discussion on the list about support for
variables tied to the context rather than to the instance or class. This
seems particularly useful for a web application where you might want to
access the request and response from the context. What is the proper name
for these kind of variables and where can I read about how to use them?

Cheers,

Jeff

-- 
Jochen "Jeff" Rick, Ph.D.
http://www.je77.com/
Skype ID: jochenrick