Hi,
is the following class side method a disaster waiting to happen?
readData "persistance :-))" |refStream | refStream := ReferenceStream fileNamed: 'HkCalendar.data'. classPool := refStream next. refStream close.
or is a class pool just another dictionary?
BTW it doesn't work but it seemed to do no harm otherwise.
So is there a quick way to store and retrieve all class variables?
Thanks,
Herbert
On 03.11.2008, at 02:10, Herbert König wrote:
Hi,
is the following class side method a disaster waiting to happen?
Yes.
readData "persistance :-))" |refStream | refStream := ReferenceStream fileNamed: 'HkCalendar.data'. classPool := refStream next. refStream close.
or is a class pool just another dictionary?
It is, but the associations in it are also referenced in the CompiledMethod's literals. The ref stream will have copies of the associations. You would have to recompile all those methods after bringing in the classpool.
BTW it doesn't work but it seemed to do no harm otherwise.
So is there a quick way to store and retrieve all class variables?
This should work:
refStream next keysAndValuesDo: [:k :v | classPool at: k put: v]
- Bert -
Hello Bert,
BF> It is, but the associations in it are also referenced in the BF> CompiledMethod's literals. The ref stream will have copies of the BF> associations. You would have to recompile all those methods after BF> bringing in the classpool.
Thanks, that makes it understandable.
Herbert mailto:herbertkoenig@gmx.net
squeak-dev@lists.squeakfoundation.org