Lazily-evaluating Squeak objects
Brian Rice
water at tscnet.com
Tue Jun 8 03:49:10 UTC 1999
I have a question of Smalltalk semantics. I am working on a
self-contained information system which I am trying to implement in
the Squeak environment. The nature of the system is such that some
of information objects must contain references to themselves, or
references to other objects that reference themselves.
Of course, my implementation takes my information objects and maps
them directly to Squeak objects, with variables containing the
object's references. Naturally, instantiating an environment
necessarily results in system deadlocks, due to self-referencing
objects resulting in infinite recursion of message calls. I've
trashed my special-purpose image several times trying to work around
this.
Now, I know that a solution would be to implement the system as a
dictionary that contained the references, with rules keeping the
dictionary true to the environment model. I've considered making a
subclass of dictionary, and implementing it that way, but I'm
inexperienced with systems Squeak programming. I'm not familiar with
the system's basic classes, so that this would be difficult. The
code would at least be complicated.
So, my question is: Is there a simple solution to this problem, or at
least one that has already been crafted, perhaps in other Smalltalk
systems? Otherwise, pointers on modifying Dictionary's methods would
help immensely.
Thanks for your time,
Brian Rice
More information about the Squeak-dev
mailing list
|