Skip to content

Commit c72256a

Browse files
committed
Merge branch 'master' of github.com:perl6/doc
2 parents 07b4c3f + 13b934d commit c72256a

File tree

4 files changed

+39
-11
lines changed

4 files changed

+39
-11
lines changed

doc/Language/unicode.pod6

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,10 @@ can combine numeric and named styles as well:
8686
say "\c[482,PENGUIN]"; # OUTPUT: «Ǣ🐧␤»
8787
8888
In addition to using C<\c[]> inside interpolated strings, you can also use
89-
the L<parse-names routine|/type/Str#routine_parse-names>
90-
or the parse-names method.
89+
the L<uniparse>:
9190
92-
say "DIGIT ONE".parse-names; # OUTPUT: «1␤»
93-
say parse-names("DIGIT ONE"); # OUTPUT: «1␤»
91+
say "DIGIT ONE".uniparse; # OUTPUT: «1␤»
92+
say uniparse("DIGIT ONE"); # OUTPUT: «1␤»
9493
9594
=head2 Name Aliases
9695

doc/Type/Cool.pod6

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -905,8 +905,8 @@ Defined as:
905905
906906
Interprets the invocant / first argument as a L<Str|/type/Str>, and returns the
907907
Unicode codepoint name of the first codepoint of the first character. See
908-
L<uninames|#routine_uninames> for a routine that works with multiple codepoints, and
909-
L<parse-names|/type/Str#method_parse-names> for the opposite direction.
908+
L<uninames|#routine_uninames> for a routine that works with multiple
909+
codepoints, and L<uniparse> for the opposite direction.
910910
911911
# Camelia in Unicode
912912
say ‘»ö«’.uniname;
@@ -936,7 +936,7 @@ codepoints in that character.
936936
say "Ḍ̇'oh".comb>>.uninames.perl;
937937
# OUTPUT: «(("LATIN CAPITAL LETTER D WITH DOT BELOW", "COMBINING DOT ABOVE").Seq, ("APOSTROPHE",).Seq, ("LATIN SMALL LETTER O",).Seq, ("LATIN SMALL LETTER H",).Seq)␤»
938938
939-
See L<parse-names|/type/Str#method_parse-names> for the opposite direction.
939+
See L<uniparse> for the opposite direction.
940940
941941
=head2 method unimatch
942942

doc/Type/DateTime.pod6

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,13 @@ unit may be passed.
281281
say $d.later(days => 2).later(:1month); # OUTPUT: «2015-04-01T00:00:00Z␤»
282282
say $d.later(days => 2).later(:month); # same, as +True === 1
283283
284-
Negative offsets are allowed, though L<#method earlier> is more idiomatic for
285-
that.
284+
If the resultant time has value C<60> for seconds, yet no leap second
285+
actually exists for that time, seconds will be set to C<59>:
286+
287+
say DateTime.new('2008-12-31T23:59:60Z').later: :1day;
288+
# OUTPUT: «2009-01-01T23:59:59Z␤»
289+
290+
Negative offsets are allowed, though L<earlier> is more idiomatic for that.
286291
287292
=head2 method earlier
288293
@@ -296,6 +301,14 @@ towards the past applied. See L<#method later> for usage.
296301
my $d = DateTime.new(date => Date.new('2015-02-27'));
297302
say $d.earlier(month => 1).earlier(:2days); # OUTPUT: «2015-01-25T00:00:00Z␤»
298303
304+
If the resultant time has value C<60> for seconds, yet no leap second
305+
actually exists for that time, seconds will be set to C<59>:
306+
307+
say DateTime.new('2008-12-31T23:59:60Z').earlier: :1day;
308+
# OUTPUT: «2008-12-30T23:59:59Z␤»
309+
310+
Negative offsets are allowed, though L<later> is more idiomatic for that.
311+
299312
=head2 method truncated-to
300313
301314
Defined as:

doc/Type/Str.pod6

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,13 +296,29 @@ See also: L«:16<FF> syntax for number literals|/syntax/Number%20literals»
296296
sub parse-names(Str:D $names --> Str:D)
297297
method parse-names(Str:D $names: --> Str:D)
298298
299+
B<DEPRECATED>. Existed only in pre-release proposal version of 6.d language and
300+
was eventually renamed to L<uniparse>. In Rakudo implementation,
301+
issues deprecation warnings in 6.d language and will be removed entirely in 6.e.
302+
303+
=head2 routine uniparse
304+
305+
sub uniparse(Str:D $names --> Str:D)
306+
method uniparse(Str:D $names: --> Str:D)
307+
299308
Takes string with comma-separated Unicode names of characters and
300309
returns a string composed of those characters. Will L«C<fail>|/routine/fail»
301310
if any of the characters' names are empty or not recognized. Whitespace
302311
around character names is ignored.
303312
304-
say "I {parse-names 'TWO HEARTS'} Perl"; # OUTPUT: «I 💕 Perl␤»
305-
'TWO HEARTS, BUTTERFLY'.parse-names.say; # OUTPUT: «💕🦋␤»
313+
say "I {uniparse 'TWO HEARTS'} Perl"; # OUTPUT: «I 💕 Perl␤»
314+
'TWO HEARTS, BUTTERFLY'.uniparse.say; # OUTPUT: «💕🦋␤»
315+
316+
Note that unlike C<\c[...]> construct available in string interpolation,
317+
C<uniparse> does not accept decimal numerical values. Use L<chr> routine to
318+
covert those:
319+
320+
say "\c[1337]"; # OUTPUT: «Թ␤»
321+
say '1337'.chr; # OUTPUT: «Թ␤»
306322
307323
=head2 routine split
308324

0 commit comments

Comments
 (0)