Help for this page
# cmp. Generic, "smart" three-way comparator. ... # Compares strings with string semantics, numbers with number semantic +s, Pair objects first by key and then by value etc. # if $a eqv $b, then $a cmp $b always returns Order::Same. Otherwise O +rder::Less or Order::More.
dd 'a ä b'.comb.sort; (" ", " ", "a", "b", "ä").Seq;
subset CzechString of String; multi sub infix:<cmp>(CzechString $a, CzechString $b) { # sort logic here }
sub czech-sort(String $a, String $b) { # sort logic here } @czech-words.sort( &czech-sort );
dd ([1,'z'], [2,'a'], ['1', 'a']).sort( *.[0,1] ); (["1", "a"], [1, "z"], [2, "a"]).Seq dd ([1,'z'], [2,'a'], ['1', 'a']).sort( { $^a[0] <=> $^b[0] || $^a[1] +cmp $^b[1] });
www.com | www.net | www.org
Never Hardly ever Occasionally Fairly regularly Frequently
Results (29 votes). Check out past polls.