WeakMessageSend event registration doesn't work with transient
arguments (was [Q] Morphic Color Problems)
Robert Withers
rwithers12 at attbi.com
Mon Jun 16 15:14:15 UTC 2003
On Monday, June 16, 2003, at 04:18 AM, Chris Burkert wrote:
> Could we now do something about it? I don't wanna override the events
> code and the only difficult part to change it is to agree on the names
> for the messages I think.
Chris, for now you can use the #when:evaluate: registration method and
specify a regular MessageSend. So, you would have:
r := RectangleMorph new openInWorld.
o := Object new.
o when: #a evaluate: (MessageSend receiver: r selector: #color:
argument: (Color black alpha: 0.3)).
On Sunday, June 15, 2003, at 11:13 PM, Ned Konz wrote:
> The problem is that the WeakMessageSends we're using (well, my name is
> all over this, so I guess I'm responsible) hold on to their receiver
> *and* their arguments weakly.
Ned, I am equally responsible for this and probably more so since it
was primarily my argument to include this "feature". IIRC, our
interest was to help the developer avoid having to explicitly
deregister event registrations, since it can be a common source of
uncollected garbage. Static typing is also supposed to help the
developer...
> We've discussed this at length in the past (like back on February 9)
> and never really did anything about it.
This really doesn't work as well as I had hoped. We probably ought to
revert back to the original mechanism which uses regular MessageSends.
What do people think about this? This would just require us to change
3 methods.
so much for strongly held opinions... :-/
Rob
More information about the Squeak-dev
mailing list
|