develooper Front page | perl.perl6.internals | Postings from July 2002

Re: vtables and multimethod dispatch

Thread Previous | Thread Next
From:
Dan Sugalski
Date:
July 11, 2002 14:04
Subject:
Re: vtables and multimethod dispatch
Message ID:
a05111b00b9539d7a0ed3@[155.43.82.52]
At 8:58 PM +0100 7/11/02, Nicholas Clark wrote:
>On Thu, Jul 11, 2002 at 10:52:31AM -0700, John Porter wrote:
>>
>>  Dan Sugalski wrote:
>>  > Nicholas Clark:
>>  > > Unless I'm being thick, x" < y" whenever x < y for positive x
>>  > > and y (ie you don't need to take the square root of the
>>  > > hypotenuse to work out which hypotenuse is shorter. And all
>>  > > we're actually interested in which one is shorter, aren't we?)
>>  >
>>  > We can also be dumb and just compare a^2+b^2.
>>
>>  Yes, that's exactly what Nick was saying.
>
>Wasn't that was Dan was saying? :-) [given his choice of words] <ducks>

Heh. I was saying the same thing Nick was (I think) because his 
superscript 2s came through as double-quotes for me. (At least I 
presume they're superscript 2s...)

>  > Assuming x and y are coordinates in a 2-d space, and that both are
>>  integers >= 0, why not just use what is affectionately called the
>>  "taxicab" metric:  x+y?  It is just as "valid" and even quicker to
>>  compute than the Euclidean metric sqrt(x^2 + y^2).
>
>I was thinking that the metric (x*x + y*y) would be fast to calculate, as
>that's all we need for ordering. (or x*x + y*y* + z*z or however many
>dimensions you happen to need)
>
>And I live in London, where we don't have a regular grid of streets, so
>our taxis don't do what yours do. :-)
>[And even if your taxis don't drive on a grid either, I suspect that they
>don't drive on the left side of the road. And I'd hate to think what metric
>they use, but it goes up after midnight and in the vicinity of Heathrow
>Airport. I don't think we would want parrot method dispatch to do that]

And most of my experience with taxicabs is in Boston and Manhattan. 
I'm not sure I want an algorithm that drives on the sidewalks, runs 
red lights, and chases pedestrians....

-- 
                                         Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
dan@sidhe.org                         have teddy bears and even
                                       teddy bears get drunk

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About