btw2, I submitted this to PharoLauncher repo. cheers -ben On Thu, Aug 3, 2017 at 9:42 PM, Ben Coman <btc@openinworld.com> wrote:
btw, for the archives, I ended up using...
packages := RPackageOrganizer default packages select:[:p| (p name includesSubstring: 'PharoLauncher') ]. packages do: [:p| p definedClasses do:[:class| class classPool keys do: [ :k | class classPool at: k put: nil ] ]].
cheers -ben
On Sat, Jul 29, 2017 at 11:22 PM, Ben Coman <btc@openinworld.com> wrote:
thx guille.
On Sat, Jul 29, 2017 at 9:40 PM, Guillermo Polito < guillermopolito@gmail.com> wrote:
Actually class variables are stored in a dictionary in a class. You can access that by saying:
aClass classPool.
So resetting all values of a class variable could be easily done with something like
aClass classPool keys do: [ :k | aClass classPool at: k put: nil ].
Maybe that could be a nice addition.
On Sat, Jul 29, 2017 at 9:51 AM, Ben Coman <btc@openinworld.com> wrote:
I want to reset all the class variables in an application to nil. I've got as far as finding them, for example...
packages := RPackageOrganizer default packages select:[:p| (p name includesSubstring: 'PharoLauncher') ]. stateToReset := packages flatCollect: [:p| p definedClasses select:[:c | (c classVarNames size > 0) and: [(c name includesSubstring: 'Configuration') not]] thenCollect:[:c| c-> c classVarNames] ]. stateToReset asDictionary keysAndValuesDo:[:class :variables| variables do: [:v| Transcript crShow: 'Clear ', class printString, ' -> ' , v printString]. ].
What could go in place of the Transcript line to set them to nil?
cheers -ben
--
Guille Polito
Research Engineer
French National Center for Scientific Research - *http://www.cnrs.fr* <http://www.cnrs.fr>
*Web:* *http://guillep.github.io* <http://guillep.github.io>
*Phone: *+33 06 52 70 66 13 <+33%206%2052%2070%2066%2013>