|
7 | 7 | class Cool is Any { }
|
8 | 8 |
|
9 | 9 | C<Cool>, also known as the B<C>onvenient B<OO> B<L>oop, is a base class
|
10 |
| -employed by a number of built-in classes that can be meaningfully |
| 10 | +employed by a number of built-in classes whose instances can be meaningfully |
11 | 11 | coerced to a string and a number. For example, an L<Array> can be used
|
12 | 12 | in mathematical operations, where its numerical representation is the
|
13 | 13 | number of elements it contains. At the same time, it can be concatenated
|
@@ -917,13 +917,18 @@ Defined as:
|
917 | 917 | sub samecase(Cool $string, Cool $pattern)
|
918 | 918 | method samecase(Cool:D: Cool $pattern)
|
919 | 919 |
|
920 |
| -Coerces the invocant (or in sub form, the first argument) to L<Str|/type/Str>, and returns a |
921 |
| -copy of C<$string> with case information for each individual character changed according to C<$pattern>. |
922 |
| -(The pattern string can contain three types of characters, i.e. uppercase, lowercase and caseless. |
923 |
| -For a given character in C<$pattern> its case information determines the case of the corresponding |
924 |
| -character in the result.) |
925 |
| -If C<$string> is longer than C<$pattern>, the case information from the last character of |
926 |
| -C<$pattern> is applied to the remaining characters of C<$string>. |
| 920 | +Coerces the invocant (or in sub form, the first argument) to L<Str|/type/Str>, |
| 921 | +and returns a copy of C<$string> with case information for each individual |
| 922 | +character changed according to C<$pattern>. |
| 923 | +
|
| 924 | +B<Note>: The pattern string can contain |
| 925 | +three types of characters, i.e. uppercase, lowercase and caseless. For a given |
| 926 | +character in C<$pattern> its case information determines the case of the |
| 927 | +corresponding character in the result. |
| 928 | +
|
| 929 | +If C<$string> is longer than |
| 930 | +C<$pattern>, the case information from the last character of C<$pattern> is |
| 931 | +applied to the remaining characters of C<$string>. |
927 | 932 |
|
928 | 933 | say "perL 6".samecase("A__a__"); # OUTPUT: «Perl 6»
|
929 | 934 | say "pERL 6".samecase("Ab"); # OUTPUT: «Perl 6»
|
@@ -1475,12 +1480,13 @@ the case it's being used as a C<sub>
|
1475 | 1480 | say 1.unpolar(⅓*pi);
|
1476 | 1481 | # OUTPUT: «0.5000000000000001+0.8660254037844386i»
|
1477 | 1482 |
|
| 1483 | +
|
1478 | 1484 | =begin comment
|
1479 | 1485 |
|
1480 | 1486 |
|
1481 | 1487 |
|
1482 | 1488 | TODO:
|
1483 |
| -sprintf, printf, samecase |
| 1489 | +sprintf, printf |
1484 | 1490 |
|
1485 | 1491 | =end comment
|
1486 | 1492 |
|
|
0 commit comments