[RFI] I suggest to remove delegation slots and PMD algorithm

Paul Dufresne dufrp at hotmail.com
Wed Aug 4 00:03:04 PDT 2004


I did not have enough sleep time, so maybe what I'll say won't
make sense, but for now it seems. I did not very well understood
PMD thesis, and how slate dispach optimizations works. But
somehow, I was thinking about an improved inspector that would
allows one to press S for seeing numerated slots, and choose the
one you want to follows by pressing the numeric key, or D for
showing numerated delegating slots, and allowing to follows them
the some way. And I was thinking about M for showing the
methods defined on current objects, and then I began to realize
that in Slate, we don't tie roles directly to the objects, but
through an algorithm.

I define for the length of this message, a ztypo, as
a selector and an arity of arguments. If 2 methods have
the same selectors and the same numbers of arguments, they
are the same ztypo.

PMD is a function that given a ztypo, and an array of arguments
(that are objects) returns a list of methods defined on these
arguments, in the most appropriate order (slate says that it
is the arguments from left to right, and if this criteria alone
results in more than one methods, that we should order these with
delegation 'awayness'.

To do this, Slate implementation use a sophisticated
PMD algorithm, and delegation slots.

The question I ask, is why to use delegation slots and sophisticated
algorithm, when one could simply store in memory (or image file),
for each ztypo, the list of methods in the order we think they
should be called?

That is, at the begining these list of methods would be empty.
Then each time a new method is defined, they would be added to the
method's ztypo's list at the correct position.

Each time the garbage collector remove an object, we would erase
every methods from the ztypo lists that was having that object
'defined' on one of their arguments.

Each time a delegation slot (really just a concept in programs,
should not be part of the implementation) is changed, we would
adjust the order of every ztypo's lists affected by it.

Calling a method would be fast, defining methods and deriving
objects would be slow (the opposite of what we have now).
But since most programs do almost all their definitions and
derivations at the beginning, and then while executing, just dispatch
this would be fast and appropriate.

--Paul

_________________________________________________________________
MSN Calendar vous aide à vous organiser et simplifie la planification des 
rencontres. http://join.msn.com/?pgmarket=fr-ca&page=features/calendar 
Commencez dès maintenant à profiter de tous les avantages de MSN Premium et 
obtenez les deux premiers mois GRATUITS*.




More information about the Slate mailing list