Re: [Fwd: Re: [FWP] sorting text in human-order]

2001-01-02 Thread Jonathan Scott Duff
On Mon, Jan 01, 2001 at 04:31:42PM -0600, Jarkko Hietaniemi wrote: (1) Quicksort has a weak point where it goes deep into the Quadratic Land: (nearly) already ordered data. No, that is not so far-fetched a case. Mergesort has no similar weakpoints: its performance is in fact

Re: [Fwd: Re: [FWP] sorting text in human-order]

2001-01-02 Thread David L. Nicol
Jarkko Hietaniemi wrote: "sort heuristic"? "DWIM both numeric and string data"? There is no "heuristic". There is no "DWIM". Perl's sort() does by default string sort based on the byte values of the strings of its argument list. That's it. Period. Full stop. Oh. $ perl -le

Re: [Fwd: Re: [FWP] sorting text in human-order]

2001-01-02 Thread Uri Guttman
"JSD" == Jonathan Scott Duff [EMAIL PROTECTED] writes: JSD On Mon, Jan 01, 2001 at 04:31:42PM -0600, Jarkko Hietaniemi wrote: (1) Quicksort has a weak point where it goes deep into the Quadratic Land: (nearly) already ordered data. No, that is not so far-fetched a case. Mergesort

Re: [Fwd: Re: [FWP] sorting text in human-order]

2001-01-01 Thread Jonathan Scott Duff
On Fri, Dec 29, 2000 at 11:47:59PM -0600, Jarkko Hietaniemi wrote: The sorting algorithm? Before 5.005 (I think...my memory is going) vendors' quicksort, after that Tom Horsley's excellent ultratuned quicksort (since vendors' quicksorts were (a) buggy (c) slow), in 5.7 mergesort by John

Re: [Fwd: Re: [FWP] sorting text in human-order]

2001-01-01 Thread Jarkko Hietaniemi
On Mon, Jan 01, 2001 at 02:04:25PM -0600, Jonathan Scott Duff wrote: On Fri, Dec 29, 2000 at 11:47:59PM -0600, Jarkko Hietaniemi wrote: The sorting algorithm? Before 5.005 (I think...my memory is going) vendors' quicksort, after that Tom Horsley's excellent ultratuned quicksort (since

Re: [Fwd: Re: [FWP] sorting text in human-order]

2000-12-29 Thread Piers Cawley
"David L. Nicol" [EMAIL PROTECTED] writes: Piers Cawley [EMAIL PROTECTED] writes: [EMAIL PROTECTED] (Yitzchak Scott-Thoennes) writes: $srt =~ tr/0-9a-z\xe9/a-jA-ZE/; # uc sort nums after letters `10' is going to sort before `2' with that rule. Having done the whole bitter

Re: [Fwd: Re: [FWP] sorting text in human-order]

2000-12-29 Thread David L. Nicol
Piers Cawley wrote: "David L. Nicol" [EMAIL PROTECTED] writes: After reading Cawley's method, I wondered if using it we could make radix-sorts the default sort method. Er... the point behind changing numbers to binary strings was emphatically not so that they could be sorted by a

Re: [Fwd: Re: [FWP] sorting text in human-order]

2000-12-29 Thread Jarkko Hietaniemi
On Sat, Dec 30, 2000 at 05:31:29AM +, David L. Nicol wrote: Piers Cawley wrote: "David L. Nicol" [EMAIL PROTECTED] writes: After reading Cawley's method, I wondered if using it we could make radix-sorts the default sort method. Er... the point behind changing numbers to

Re: [Fwd: Re: [FWP] sorting text in human-order]

2000-12-28 Thread John Porter
Nathan Torkington wrote: By "pluggable" you mean that sort() should be overridable? use D::Oh s s\?s.s; -- John Porter What would Gabrielle do?

Re: [Fwd: Re: [FWP] sorting text in human-order]

2000-12-28 Thread Dan Sugalski
At 03:43 PM 12/28/00 -0500, John Porter wrote: Dan Sugalski wrote: use sort qw(radix_sort); sort \radix_sort @data; Isn't that the slot where the comparison function goes? Maybe something more like this: use sort::radix_sort; sort @data; # magically uses radix_sort instead of

Re: [Fwd: Re: [FWP] sorting text in human-order]

2000-12-28 Thread John Porter
Jarkko Hietaniemi wrote: If someone wants to play with such ideas there's Perl 5.7 which has a new mergesort as the incore sorting algorithm, while Perl 5.6 and before used quicksort. I'm triggering on the word "incore" there... I seem to recall someone suggested on perl6-language a while

Re: [Fwd: Re: [FWP] sorting text in human-order]

2000-12-28 Thread Jarkko Hietaniemi
On Wed, Dec 27, 2000 at 06:36:56PM -0600, David L. Nicol wrote: Is there a perl6 sort committee yet? AFter reading Cawley's method here, I wonder if using it we could make radix-sorts the default sort method. Radix sorts are great if the data cooperates, radix sorts can really fly in such

Re: [Fwd: Re: [FWP] sorting text in human-order]

2000-12-28 Thread Dan Sugalski
At 06:36 PM 12/27/00 -0600, David L. Nicol wrote: Is there a perl6 sort committee yet? AFter reading Cawley's method here, I wonder if using it we could make radix-sorts the default sort method. I don't see any reason to not allow this--perhaps a lexically scoped assignment to

Re: [Fwd: Re: [FWP] sorting text in human-order]

2000-12-28 Thread John Porter
Dan Sugalski wrote: use sort qw(radix_sort); sort \radix_sort @data; Isn't that the slot where the comparison function goes? Maybe something more like this: use sort::radix_sort; sort @data; # magically uses radix_sort instead of default. -- John Porter What would Gabrielle do?

Re: [Fwd: Re: [FWP] sorting text in human-order]

2000-12-28 Thread Jarkko Hietaniemi
On Thu, Dec 28, 2000 at 03:43:21PM -0500, John Porter wrote: Dan Sugalski wrote: use sort qw(radix_sort); sort \radix_sort @data; Isn't that the slot where the comparison function goes? Maybe something more like this: use sort::radix_sort; sort @data; # magically uses

Re: [Fwd: Re: [FWP] sorting text in human-order]

2000-12-28 Thread Peter Scott
At 04:34 PM 12/28/00 -0500, John Porter wrote: I seem to recall someone suggested on perl6-language a while back* (or was it perl6-internals?) that perl ought also to support efficient sorting of large volumes of data by using disk, the way unix sort does. Pluggable algorithms would make this

[Fwd: Re: [FWP] sorting text in human-order]

2000-12-27 Thread David L. Nicol
Is there a perl6 sort committee yet? AFter reading Cawley's method here, I wonder if using it we could make radix-sorts the default sort method. Original Message Return-Path: [EMAIL PROTECTED] Delivered-To: [EMAIL PROTECTED] Received: (qmail 10490 invoked from network); 29

Re: [Fwd: Re: [FWP] sorting text in human-order]

2000-12-27 Thread John Porter
David L. Nicol wrote: Is there a perl6 sort committee yet? AFter reading Cawley's method here, I wonder if using it we could make radix-sorts the default sort method. Perl6 ought to support pluggable sort algorithms, just as Perl now supports pluggable comparison functions. -- John

Re: [Fwd: Re: [FWP] sorting text in human-order]

2000-12-27 Thread Nathan Torkington
John Porter writes: Perl6 ought to support pluggable sort algorithms, just as Perl now supports pluggable comparison functions. By "pluggable" you mean that sort() should be overridable? Nat