prototype multiple dispatch creates uncollectable garbage?

Lee Salzman lsalzman1 at cox.net
Tue Sep 7 17:22:00 PDT 2004


On Tue, Sep 07, 2004 at 10:03:50AM -0700, James McCartney wrote:
> 
> On Sep 7, 2004, at 5:00 PM, Lee Salzman wrote:
> 
> >This would just be the same as having generic functions, i.e. won't
> >work.
> 
> I don't see how this is equivalent to generic functions. generic 
> functions are global. I am proposing to store a method in the first 
> argument, i.e. local. please explain.
> 

Think about what happens when an object with roles is cloned, or when a
delegation hierarchy is changed, just as some example circumstances PMD
was designed to handle. The situation you propose would require updating 
the tables every time these circumstances occurred, and moreover knowing
that based on either of these operations the tables need to be updated
and how, as well as where all these tables are to update in the first 
place. Please also note that Slate does not enforce any "parent" 
relationships, and these are left entirely up to the programmer to supply 
with delegation, which was supposed to be one of the main attractions.

> >One easy way around this is just to GC roles/methods by whether or
> >not all role positions have some roles pointing to the method.
> 
> in other words you have to use reference counting.
> 

This is not reference counting, since we're not trying to figure out
if there are any roles pointing to a method definition. In this case, it
is still marking, since you would be marking positions in a bit vector
and comparing the resulting bit vector to the one indicating dispatch
roles. This can happen in parallel with a normal GC.

Lee




More information about the Slate mailing list