Sort stability: Difference between revisions
Content added Content deleted
(→{{header|Perl 6}}: Marked incorrect, sorry. The demonstration would require sorting on the second, not the first element.) |
(→{{header|Perl 6}}: fix index) |
||
Line 154: | Line 154: | ||
Short demonstration for sorting only on the first item of each array: |
Short demonstration for sorting only on the first item of each array: |
||
{{incorrect|perl6|The demonstration would require sorting on the second, not the first element.}} |
|||
<lang perl6> |
<lang perl6> |
||
use v6; |
use v6; |
||
Line 164: | Line 164: | ||
; |
; |
||
.say for @cities.sort: { .[ |
.say for @cities.sort: { .[1] }; |
||
</lang> |
</lang> |
||