Changeset 311

Show
Ignore:
Timestamp:
02/26/05 11:37:28 (4 years ago)
Author:
autrijus
svk:copy_cache_prev:
1041
Message:

* resurrect quicksort; need to fix chain

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • examples/quicksort.p6

    r80 r311  
    55 
    66multi sub quicksort ( *$x, *@xs ) { 
    7     my @pre  = @xs.grep:{ $_ < $x }; 
    8     my @post = @xs.grep:{ $_ >= $x }; 
     7    my @pre  = @xs.grep:{ $x > $_}; 
     8    my @post = @xs.grep:{ $x <= $_ }; 
     9#   my @post = @xs.grep:{ $_ >= $x }; # XXX FIXME 
    910    (@pre.quicksort, $x, @post.quicksort); 
    1011}