Sort using a custom comparator: Difference between revisions
m
→{{header|Wren}}: Minor tidy
(Add Zig example) |
m (→{{header|Wren}}: Minor tidy) |
||
(One intermediate revision by one other user not shown) | |||
Line 1,621:
=={{header|Elena}}==
ELENA
<syntaxhighlight lang="elena">import extensions;
import system'routines;
Line 1,633:
console.printLine("Descending length: ", items.clone()
.sort::(p,n => p.Length > n.Length).asEnumerable());
console.printLine("Ascending order: ", items.clone()
.sort::(p,n => p.toUpper(invariantLocale) < n.toUpper(invariantLocale)).asEnumerable())
}</syntaxhighlight>
{{out}}
Line 4,198:
=={{header|Wren}}==
{{libheader|Wren-sort}}
<syntaxhighlight lang="
var cmp = Fn.new { |s, t|
|