[ENH] saveClassVars-ls
Lex Spoon
lex at cc.gatech.edu
Wed Jan 23 06:11:52 UTC 2002
This semester, Mark Guzdial's sophomore OO class is using Squeak's
project exports to turn in assignments. Sure enough, 100+ students have
found a small problem.
In short, if you export a project and choose to send along its change
set, class variables of the project's classes do not get saved. It
seems like they should: conceptually, those classes belong to the
project, and the value of the class variables is part of the class
definition.
The below changeset makes this happen, albeit in a very hackish way:
before exporting a project, all of the project's newly defined classes
are allowed to stash their classPool into a property of the project's
world morph; when a project is loaded, all of these classes are given a
chance to retrieve their classPool.
I tried it once and it seemed to work. :)
Does anyone spot any major problems with this approach? And can anyone
think of a cleaner way to do this? I'm thinking to share it around the
class....
from preamble:
"Change Set: saveClassVars-ls
Date: 23 January 2002
Author: Lex Spoon
If a project is being exported along with its changeset, and the
project's changeset defines a new class, then this changeset causes the
project's class variables to be exported and restored.
The implementation is very hackish; someone who understands image
segments and project files could doubtless do something cleaner."!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: saveClassVars-ls.cs.gz
Type: application/octet-stream
Size: 3842 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20020123/000c0ff7/saveClassVars-ls.cs.obj
More information about the Squeak-dev
mailing list
|