>>>>> "TSN" == Timothy S Nelson <wayl...@wayland.id.au> writes:

  TSN>          Hi all.  I saw the new "sort" idea on the Rakudo blog:
  TSN> http://www.rakudo.org/2008/12/its-sort-of-like.html

  TSN>          ...and wondered if we can get it in the spec, as I haven't
  TSN>          seen any discussion on it or anything.

well, it is sort (sic) of just like what damian posted almost 5 years
ago. i found this post covers something very similar to the rakudo
implementation. i can't seem to find this proposal in any of the
synopses (at least a quick google search found nothing) so maybe it
needs to be put in the specs/synopses.


there was a whole series of threads about sorting at that time. 

the end of that post has this:

     @sorted = sort {(%M{$^a}//-M $^a) <=> (%M{$^b}//-M $^b)} @unsorted;

     @sorted = map $_[1], sort {$^a[0] <=> $^b[0]}, map [-M,$_], @unsorted;

would both become:

     @sorted = sort {-M} @unsorted;


so you can see a similar single extract code for both $^a and $^b. and
this exists in perl5 in Sort::Maker (mine) and i think also in Perl6::Sort
(which is damian's). 

so you have not discovered something new in perl or perl6 regarding
sorting. it has been covered and in depth but never properly integrated
into the p6 docs.



Uri Guttman  ------  u...@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------

Reply via email to