Skip to content

Commit 199fa86

Browse files
committed
Redirects links
And also closes #2524 again. Fixes definition of operators, and does some reflow.
1 parent 8d9f331 commit 199fa86

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

doc/Language/operators.pod6

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1529,33 +1529,43 @@ if C<$a eqv $b>, then C<$a cmp $b> always returns C<Order::Same>.
15291529
15301530
=head2 infix C<coll>
15311531
1532-
Defined as:
1532+
Defined asN<These are not yet implemented in the JVM>:
15331533
15341534
multi sub infix:<coll>(Str:D \a, Str:D \b --> Order:D)
15351535
multi sub infix:<coll>(Cool:D \a, Cool:D \b --> Order:D)
1536-
multi sub infix:<coll>(Pair:D \a, Pair:D \b)
1537-
multi sub infix:<coll>(Str:D \a, Str:D \b)
1536+
multi sub infix:<coll>(Pair:D \a, Pair:D \b --> Order:D)
15381537
1539-
C<coll> is a sorting operator that takes pairs of C<Str>s, C<Cool>s or C<Pair>s and returns an C<Order> that uses the C<$*COLLATION> order. The default behavior disregards diacritic marks and capitalization, for instance.
1538+
C<coll> is a sorting operator that takes pairs of C<Str>s, C<Cool>s or C<Pair>s
1539+
and returns an C<Order> that uses the C<$*COLLATION> order. The default behavior
1540+
disregards diacritic marks and capitalization, for instance.
15401541
15411542
say "b" cmp "à"; # OUTPUT: «Less␤»
15421543
say "b" coll "à"; # OUTPUT: «More␤»
15431544
1544-
In the first case, lexicographic or codepoint order is taken into account. In the second, which uses C<coll>, the diacritic is not considered and sorting happens according to intuitive order.
1545+
In the first case, lexicographic or codepoint order is taken into account. In
1546+
the second, which uses C<coll>, the diacritic is not considered and sorting
1547+
happens according to intuitive order.
15451548
15461549
=head2 infix C«unicmp»
15471550
1551+
Defined asN<These are not yet implemented in the JVM>:
1552+
15481553
multi sub infix:<unicmp>(Str:D \a, Str:D \b --> Order:D)
1549-
multi sub infix:<unicmp>(Pair:D \a, Pair:D \b)
1554+
multi sub infix:<unicmp>(Pair:D \a, Pair:D \b --> Order:D)
1555+
multi sub infix:<coll>(Pair:D \a, Pair:D \b --> Order:D)
15501556
15511557
Unlike the cmp operator which sorts according to codepoint, C<unicmp> and
1552-
C<coll> sort according to how most users would expect, that is, disregarding aspects of the particular character like capitalization.
1558+
C<coll> sort according to how most users would expect, that is, disregarding
1559+
aspects of the particular character like capitalization.
15531560
15541561
say 'a' unicmp 'Z'; # Less
15551562
say 'a' coll 'Z'; # Less
15561563
say 'a' cmp 'Z'; # More
15571564
1558-
The main difference between C<coll> and C<unicmp> is that the behavior of the former can be changed by the L<C<$*COLLATION>|/language/experimental#index-entry-%24%2ACOLLATION-%24%2ACOLLATION> dynamic variable.
1565+
The main difference between C<coll> and C<unicmp> is that the behavior of the
1566+
former can be changed by the
1567+
L<C<$*COLLATION>|/type/Any#index-entry-%24*COLLATION-%24*COLLATION> dynamic
1568+
variable.
15591569
15601570
=head2 infix C«leg»
15611571
@@ -1564,7 +1574,8 @@ The main difference between C<coll> and C<unicmp> is that the behavior of the fo
15641574
15651575
X<String three-way comparator>. Short for I<less, equal or greater?>.
15661576
1567-
Coerces both arguments to L<Str|/type/Str> and then does a lexicographic comparison.
1577+
Coerces both arguments to L<Str|/type/Str> and then does a lexicographic
1578+
comparison.
15681579
15691580
say 'a' leg 'b'; # OUTPUT: «Less␤»
15701581
say 'a' leg 'a'; # OUTPUT: «Same␤»

0 commit comments

Comments
 (0)