Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are process-specific variables?

I was trying to load a package apparently written for an earlier version of Pharo (Ratpack, from http://ss3.gemstone.com/ss/RatPack.html into Pharo 1.4).

There I got deprecation warnings about environmentAt:put: not being supported for Project.

The way to go, according to the documentation, is to use ProcessSpecificVariable.

My questions are:

  • What are they?
  • How do I use them?
  • How to port "older" (deprecated) code to this new system?

Thanks!

like image 590
Sebastian N. Avatar asked Dec 03 '12 12:12

Sebastian N.


Video Answer


1 Answers

You can find discussion of PSS in issue tracker

Here is the snippet by Igor on how to use ProcessSpecificVariables :

Suppose MyProcessSpecificVar is a subclass of ProcessSpecificVariable.

Then you can do:

[ MyProcessSpecificVar value: foo. ] fork.

[ MyProcessSpecificVar value. ] fork.

etc, i.e. in same way as old implementation allows to do it.

But with new implementation , you can also use instances of it, so you don't have to create a new class per each process-specific var you might want to use:

mykey := MyProcessSpecificVar new.


[ mykey value ] fork.
[ mykey value: 10 ] fork.
like image 176
Davorin Ruševljan Avatar answered Nov 11 '22 20:11

Davorin Ruševljan