I think it is an interesting programming topic (and I did not mean my earlier comments to be absolute - it was directed at the seemingly unresolvable debates about whether or not do such and such). Most sorting is done, it seems, on some sort of scalar level, and I was interested in the idea of using each sort item as a description of something else, in this case a point on a plane. (I'm not sure why your #4 comment means my function is wrong. Unless you mean that the resulting sorted list is in order according to "its distance from a point 0,0 that defines the most 'lower-left' point of an arbitrary plane". I.E. it only works in quadrant II of that old x-y graph. Please explain, if not. Maybe what's more useful would be the function sorting in terms of distance from any point, where I think the deltas come back in.) To me it could relate to some sort of abstraction on sort (using objects, blocks whatever) that might be useful. I guess I knew I was opening myself up to a "look who's talking" attitude, but I was thinking about a real-world problem in terms of some abstraction and trying to really understand what the original poster's interleave method was getting at. Often that leads to a cool generalization that can be used elsewhere. That's why I considered it to be a programming topic. You could argue it belonged in a different list, but this is where the original post was, and I'm trying to learn REBOL, so it's where I posted. Is that the same as a thread discussing why MS is successful, or why they suck? Again, on some level you could argue it is. Up to you, I guess. --- [EMAIL PROTECTED] wrote: > Hi, > > although your question has a little in common with > Rebol, my answers are as > follows: > > 1. It would be more precise to interleave each bit - > ie. each binary digit - > as the smallest unit of information > > 2. in that case the bit - sort yields: > [0,0 2,2 1,5 5,1] > > 3. as you pointed out, the result of the sort > doesn't depend on the > representation, but on the comparison function, any > suitable representation > can do > > 4. your suggestion doesn't work, because you need > close things in the terms > of distance to remain close in the terms of sort. > Your suggestion works only > in the neighborhood of the 0,0 point > > Best regards > Ladislav > > ----- Original Message ----- > From: <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Monday, September 25, 2000 1:04 PM > Subject: [REBOL] Interleaving of strings question > > > > I was thinking about the earlier postings about > > sorting coordinates by interleaving digits of the > 2 > > axis values. The interleaving, it would seem, is > to > > make the longitude as significant as the latitude, > in > > terms of distance from other points. Ignoring the > > need to have the lat/long pairs stored that way > for > > later processing, and ignoring stated expected > values > > for the coordinates I thought: > > > > 1. Wouldn't it be more precise to interleave each > > digit? > > > > 2. In terms of a regular x,y system, even that > would > > be incorrect sometimes. E.G.: [ 0,0 1,5 2,2 5,1 ] > (a > > sorted set of simplified coordinates) isn't > correct. > > 2,2 is closer to 0,0; 1,5 and 5,1 are the same > > distance from 0,0. > > > > 3. Could pairs or tuples be used? Answer: pairs > > didn't sort that way and I have no reason to > assume > > sort would think of tuples as coordinates. > > > > 4. Wouldn't it be the least convoluted to have a > > /compare function for sort that understood that > all > > components of the coordinate were equally > significant? > > That way there's no manipulating the coordinates, > and > > it should be the most precise. > > > > Would a Pythagorean type thing work, because it > looks > > like simply summing the absolute differences > between > > each coordinate component isn't right: > > > > 1,1 to 1,5 = 4 ((1-1)+(5-1)) > > 1,1 to 2,4 = 4 ((2-1)+(4-1)) > > > > yet 2,4 is closer to 1,1 than is 1,5. Until the > real > > distance is needed, I don't think you'd have to > take > > the square root of the sum (and how do you do that > for > > 3-dimensions, does it become cubed and cube root - > > aha) > > > > (ABS(x1-x2) to the nth) + (ABS(y1-y2) to the nth) > ... > > + (ABS(n1-n2) to the nth) > > > > > > Comments? Is this right? > > > > __________________________________________________ > > Do You Yahoo!? > > Send instant messages & get email alerts with > Yahoo! Messenger. > > http://im.yahoo.com/ > > > > > > __________________________________________________ Do You Yahoo!? Send instant messages & get email alerts with Yahoo! Messenger. http://im.yahoo.com/
