prototype multiple dispatch creates uncollectable garbage?
James McCartney
asynth at io.com
Fri Sep 3 09:35:18 PDT 2004
This is a post I made on the self-list which I am reposting here with a
more attention getting subject line.
I am curious what the solution is, if there is one. I just joined the
list so perhaps this has been discussed. The archives don't appear to
be searchable.
On Aug 31, 2004, at 5:45 PM, Jecel Assumpcao Jr wrote:
> Or even
> better, see the Prototype Multiple Dispatch in Slate:
>
> http://tunes.org/~eihrul/pmd.pdf
> http://tunes.org/~eihrul/talk.pdf
>
> and
>
> http://slate.tunes.org/
>
> They currently use a very Self-like inheritance model, but plan to move
> in a different direction.
One problem with the prototype multiple dispatch scheme, if I
understand it correctly, is that methods become uncollectable garbage
unless ALL of their specialized arguments are collectable. This is a
problem if you are multiple dispatching on arguments that live forever
like true, false and nil. Because roles are stored in each object that
participates in a method dispatch, once you define a method on an
object, that method lives as long as any of the argument objects lives.
This would make it tricky to create ephemeral objects with unique
behavior that use multiple dispatch.
Hopefully one of the Slate folks can speak to this..
---end of original post---
for example see page 16 of talk.pdf.
The "encounter" methods cannot be garbage collected until both of their
referrers can be. In the case given it would not be a problem since
these are traits objects and presumably live for the life of the
program, but it would be a problem for a temporary object with unique
behavior.
--
--- james mccartney
More information about the Slate
mailing list