Musing on PMD dispatch problems

Lee Salzman lsalzman at telerama.com
Tue Jun 3 16:32:26 PDT 2003


Well, that full ordering makes a lot more sense than the current one,
and is exactly the one that CLOS uses, leftmost argument positions have
higher precedence than rightmost.

This was ideally how PMD should have behaved in the first place, but
didn't quite because of these weird ambiguities. :)

Lee

On Tue, Jun 03, 2003 at 08:25:36PM -0300, Jecel Assumpcao Jr wrote:
> On Tuesday 03 June 2003 10:50, Lee Salzman wrote:
> > 2)
> >    This is the more interesting thought that occurred to me, and the
> > reason I felt compelled to write a long drawn out post. Quite simply,
> > scan down the columns first instead of rows! This yields the exact
> > same method ordering as the first solution, but it will actually make
> > the PMD algorithm SIMPLER. For multiple dispatch cases this could
> > possibly make PMD slower, but for single dispatch cases, it can
> > actually make PMD faster since it will actually do no more work than
> > single dispatch! As soon as you would see a method in the first
> > column, you would simply dispatch it - no different than what single
> > dispatch itself does.
> 
> Ok, so now a single dispatch method would override a multiple dispatch 
> one higher up: z at A foo: w  would be chosen over z@(A parent) foo: w at B 
> even when w is a B.
> 
> Was this also the case in the current algorithm?
> 
> I wonder if the "parent flattening" I do in my current Self/Smalltalk 
> implementation would work here as well...
> 
> -- Jecel



More information about the Slate mailing list