The cmp
operator works on code numbers, or at least that's what I think it does because the docs aren't explicit on that and don't mention any localization stuff.
Can I make it sort by other collations? I know I tell sort how to compare, but I figure it must be in there already (somewhere).
Collation is available as an experimental feature:
my @list = <a ö ä Ä o ø>;
say @list.sort; # (a o Ä ä ö ø)
use experimental :collation;
say @list.collate; # (a ä Ä o ö ø)
$*COLLATION.set(:tertiary(False));
say @list.collate; # (a Ä ä o ö ø)
Please give feedback on this feature to help it move out of the "experimental" state and be included in v6.d.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With