On Wed, Apr 28, 2004 at 06:36:34PM -0400, Dan Sugalski wrote: > At 2:56 PM -0700 4/28/04, Larry Wall wrote: > >On Wed, Apr 28, 2004 at 05:20:53PM -0400, Dan Sugalski wrote:
> >: The second question is "if we do, how do we figure which method is > >: closest?" > >: > >: Personally I'm of the geometric distance school here, but it can get > >: a bit tricky, so I'm all for discussion on it. So... let's have at > >: it. :) > > > >Different languages might specify different semantics. > > Well... that's not going to work. Once you start crossing languages > it all goes downhill really quickly. It's bad enough with a single > thing, as you can go mixing languages in the tree, but in the MMD > case it's possible (quite likely, really) that you'll end up mixing > languages, and that's going to cause problems. > > I do remember agreeing to all this, though. I may well regret that. > > Okay, for now we'll just calculate the sum of both sides distance and > be done with it. As in the Manhattan distance? Given that all we're interested in is finding the closest, not the distance itself, what's wrong with using square of geometric distance? (Given that the squares of positive numbers sort in the same order as the numbers themselves.) One can also do weightings with this still in integer arithmetic, if weightings are small positive integers. (And we don't overflow) Nicholas Clark