You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/Language/experimental.pod6
+5-42Lines changed: 5 additions & 42 deletions
Original file line number
Diff line number
Diff line change
@@ -28,56 +28,19 @@ not yet rendered properly.
28
28
29
29
=head1Collation
30
30
31
-
Is available in release 2017.02. To use:
31
+
The L<collate> and L<coll> are no longer experimental. However,
32
+
these methods are affected by the X<B<$*COLLATION>|$*COLLATION>, which configures the four collation levels. While the Primary, Secondary and Tertiary mean different things for different scripts, for the Latin script used in English they mostly correspond with Primary being Alphabetic, Secondary being Diacritics and Tertiary being Case.
32
33
33
-
use experimental :collation;
34
-
35
-
Allows the use of the X<B<unicmp>|unicmp, Routine> and X<B<coll>|coll, method> operators.
36
-
Also allows the use of the X<B<collate>|collate> method. unicmp and coll are like cmp, except
37
-
it implements the Unicode Collation Algorithm.
38
-
39
-
B<coll> and the B<collate> method are affected by the X<B<$*COLLATION>|$*COLLATION>
40
-
variable, while B<unicmp> is not.
41
-
Unlike the cmp operator which sorts according to codepoint, B<unicmp> and
42
-
B<coll> sort according to how most users would expect.
43
-
44
-
use experimental :collation;
45
-
say 'a' unicmp 'Z'; # Less
46
-
say 'a' cmp 'Z'; # More
47
-
48
-
B<coll> and the B<collate> method are both configurable by setting the
49
-
B<$*COLLATION> variable.
50
-
51
-
=head2collate (method)
52
-
53
-
You can use the collate method similar to how one would use the B<sort> method.
54
-
55
-
use experimental :collation;
56
-
say ('a', 'Z').sort; # (Z a)
57
-
say ('a', 'Z').collate; # (a Z)
58
-
say <ä a o ö>.collate; # (a ä o ö)
59
-
my %hash = 'aa' => 'value', 'Za' => 'second';
60
-
say %hash.collate; # (aa => value Za => second);
61
-
62
-
=head2Collation Levels
63
-
64
-
There are four collation levels which are all configurable.
65
-
66
-
While the Primary, Secondary and Tertiary mean different things for different
67
-
scripts, for the Latin script used in English they mostly correspond with
68
-
Primary being Alphabetic, Secondary being Diacritics and Tertiary being Case.
69
-
70
-
In the below example you can see how when we disable tertiary collation which in
34
+
In the example below you can see how when we disable tertiary collation which in
71
35
Latin script generally is for case, and also disable quaternary which breaks
72
36
any ties by checking the codepoint values of the strings, we get B<Same> back
0 commit comments