Skip to content

Commit c1df457

Browse files
Merge pull request #1159 from Altai-man/master
Fix broken examples, a couple of signatures and one table
2 parents 03431cd + 84c8e02 commit c1df457

File tree

10 files changed

+60
-61
lines changed

10 files changed

+60
-61
lines changed

doc/Type/Cool.pod6

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -862,10 +862,10 @@ C<$pattern> is applied to the remaining characters of C<$string>.
862862
863863
Defined as:
864864
865-
sub uniprop(Str(Cool), |c)
866-
sub uniprop(Int:D $code, Stringy:D $propname)
867-
sub uniprop(Str, $propname, Stringy:D $propname)
868-
method uniprop(|c) { uniprop(self, |c)
865+
multi sub uniprop(Str(Cool), |c)
866+
multi sub uniprop(Int:D $code, Stringy:D $propname)
867+
multi sub uniprop(Str, $code, Stringy:D $propname)
868+
multi method uniprop(|c)
869869
870870
Interprets the invocant as a L<Str|/type/Str>, and returns the
871871
L<unicode property|http://userguide.icu-project.org/strings/properties> of the first
@@ -934,8 +934,8 @@ codepoints in that character.
934934
935935
Defined as:
936936
937-
sub unimatch(Str:D $str, |c)
938-
unimatch(Int:D $code, Stringy:D $pvalname, Stringy:D $propname = $pvalname)
937+
multi sub unimatch(Str:D $str, |c)
938+
multi unimatch(Int:D $code, Stringy:D $pvalname, Stringy:D $propname = $pvalname)
939939
940940
Checks if the given integer codepoint or the first letter of the string given have a unicode property
941941
equal to the value you give. If you supply the Unicode property to be checked it will only return True

doc/Type/Date.pod6

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -314,27 +314,27 @@ qqx{mplayer wake-me-up.mp3};
314314
315315
=head2 sub infix:<->
316316
317-
sub infix:<-> (Date:D, Int:D --> Date:D)
318-
sub infix:<-> (Date:D, Date:D --> Int:D)
317+
multi sub infix:<-> (Date:D, Int:D --> Date:D)
318+
multi sub infix:<-> (Date:D, Date:D --> Int:D)
319319
320320
Takes a date to subtract from and either an L«C<Int>|/type/Int», representing
321321
the number of days to subtract, or another L«C<Date>|/type/Date» object.
322322
Returns a new L«C<Date>|/type/Date» object or the number of days between the
323323
two dates, respectively.
324324
325-
say Date.new('2016-12-25') - Date.new('2016-12-24') # 1
326-
say Date.new('2015-12-25') - Date.new('2016-11-21') # -332
327-
say Date.new('2016-11-21') - 332 # 2015-12-25
325+
say Date.new('2016-12-25') - Date.new('2016-12-24'); # 1
326+
say Date.new('2015-12-25') - Date.new('2016-11-21'); # -332
327+
say Date.new('2016-11-21') - 332; # 2015-12-25
328328
329329
=head2 sub infix:<+>
330330
331-
sub infix:<+> (Date:D, Int:D --> Date:D)
332-
sub infix:<+> (Int:D, Date:D --> Date:D)
331+
multi sub infix:<+> (Date:D, Int:D --> Date:D)
332+
multi sub infix:<+> (Int:D, Date:D --> Date:D)
333333
334334
Takes an L«C<Int>|/type/Int» and adds that many days to the given
335335
L«C<Date>|/type/Date» object.
336336
337-
say Date.new('2015-12-25') + 332 # 2016-11-21
338-
say 1 + Date.new('2015-12-25') # 2015-12-26
337+
say Date.new('2015-12-25') + 332; # 2016-11-21
338+
say 1 + Date.new('2015-12-25'); # 2015-12-26
339339
340340
=end pod

doc/Type/DateTime.pod6

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,8 @@ Returns a DateTime object for the same time, but in the local time zone
374374
375375
=head2 sub infix:<->
376376
377-
sub infix:<-> (DateTime:D, Duration:D --> DateTime:D)
378-
sub infix:<-> (DateTime:D, DateTime:D --> Duration:D)
377+
multi sub infix:<-> (DateTime:D, Duration:D --> DateTime:D)
378+
multi sub infix:<-> (DateTime:D, DateTime:D --> Duration:D)
379379
380380
Takes a L«C<DateTime>|/type/DateTime» to subtract from and either a
381381
L«C<Duration>|/type/Duration» or another C<DateTime> object. Returns a new
@@ -391,8 +391,8 @@ in the returned C<DateTime> object.
391391
392392
=head2 sub infix:<+>
393393
394-
sub infix:<+> (DateTime:D, Duration:D --> DateTime:D)
395-
sub infix:<+> (Duration:D, DateTime:D --> DateTime:D)
394+
multi sub infix:<+> (DateTime:D, Duration:D --> DateTime:D)
395+
multi sub infix:<+> (Duration:D, DateTime:D --> DateTime:D)
396396
397397
Takes a L«C<DateTime>|/type/DateTime» and increases it by the given
398398
L«C<Duration>|/type/Duration», preserving the timezone.

doc/Type/Hash.pod6

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -662,9 +662,9 @@ empty angle brackets in which case all the keys and values will be listed:
662662
663663
my %h1 = a => 1;
664664
my %h2 = a => 1, b => 2;
665-
say %h1<>:k # (a)
666-
say %h1<>:v # (1)
667-
say %h2<>:k # (a b)
668-
say %h2<>:v # (1 2)
665+
say %h1<>:k; # (a)
666+
say %h1<>:v; # (1)
667+
say %h2<>:k; # (a b)
668+
say %h2<>:v; # (1 2)
669669
670670
=end pod

doc/Type/Int.pod6

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ Radix notation also supports round and angle brackets which allow you to parse
3131
a string for a given base, and putting together digits into a whole number
3232
respectively:
3333
34-
:16("9F") # 159
35-
:100[99, 2, 3] # 990203
34+
:16("9F"); # 159
35+
:100[99, 2, 3]; # 990203
3636
3737
These notations allow you to use variables, too:
3838

doc/Type/Setty.pod6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ object, this is just the number of elements.
124124
125125
Defined as:
126126
127-
method default returns False
127+
method default(--> False)
128128
129129
Returns the default value of the invocant, i.e. the value which is returned
130130
when trying to access an element in the C<Setty> object which has not been

doc/Type/Slip.pod6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ includes C<return> and C<take>.
5151
5252
my \l = gather for 1..10 -> $a, $b { take |($a, $b) }; say l.perl;
5353
# OUTPUT«((1, 2), (3, 4), (5, 6), (7, 8), (9, 10)).Seq␤»
54-
my \l = gather for 1..10 -> $a, $b { take ($a, $b).Slip }; say l.perl;
54+
my \m= gather for 1..10 -> $a, $b { take ($a, $b).Slip }; say m.perl;
5555
# OUTPUT«(1, 2, 3, 4, 5, 6, 7, 8, 9, 10).Seq␤»
5656
5757
=head1 Methods

doc/Type/Str.pod6

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -204,18 +204,18 @@ Takes as an argument the number of matches to return, stopping once the specifie
204204
Examples:
205205
=begin code
206206
207-
say "properly".match('perl'); # 「perl」
208-
say "properly".match(/p.../); # 「perl」
209-
say "1 2 3".match([1,2,3]); # 「1 2 3」
210-
say "a1xa2".match(/a./, :continue(2)) #「a2」
211-
say "abracadabra".match(/ a .* a /, :exhaustive); #(「abracadabra」 「abracada」 「abraca」 「abra」 「acadabra」 「acada」 「aca」 「adabra」 「ada」 「abra」)
212-
say 'several words here'.match(/\w+/,:global) #(「several」 「words」 「here」)
213-
say 'abcdef'.match(/.*/, :pos(2)) #「cdef」
214-
say "foo[bar][baz]".match(/../, :1st); # 「fo」
215-
say "foo[bar][baz]".match(/../, :2nd); # 「o[」
216-
say "foo[bar][baz]".match(/../, :3rd); # 「ba」
217-
say "foo[bar][baz]".match(/../, :4th); # 「r]」
218-
say "foo[bar][baz]bada".match('ba', :x(2)); # (「ba」 「ba」)
207+
say "properly".match('perl'); # 「perl」
208+
say "properly".match(/p.../); # 「perl」
209+
say "1 2 3".match([1,2,3]); # 「1 2 3」
210+
say "a1xa2".match(/a./, :continue(2)); # 「a2」
211+
say "abracadabra".match(/ a .* a /, :exhaustive); # (「abracadabra」 「abracada」 「abraca」 「abra」 「acadabra」 「acada」 「aca」 「adabra」 「ada」 「abra」)
212+
say 'several words here'.match(/\w+/,:global); # (「several」 「words」 「here」)
213+
say 'abcdef'.match(/.*/, :pos(2)); # 「cdef」
214+
say "foo[bar][baz]".match(/../, :1st); # 「fo」
215+
say "foo[bar][baz]".match(/../, :2nd); # 「o[」
216+
say "foo[bar][baz]".match(/../, :3rd); # 「ba」
217+
say "foo[bar][baz]".match(/../, :4th); # 「r]」
218+
say "foo[bar][baz]bada".match('ba', :x(2)); # (「ba」 「ba」)
219219
220220
=end code
221221
@@ -656,19 +656,16 @@ used to build Perl 6:
656656
657657
(Note: None of the following have been implemented.)
658658
659-
hh interpret integer as C type "char" or "unsigned
660-
char"
661-
h interpret integer as C type "short" or
662-
"unsigned short"
663-
j interpret integer as C type "intmax_t", only with
664-
a C99 compiler (unportable)
665-
l interpret integer as C type "long" or
666-
"unsigned long"
667-
q, L, or ll interpret integer as C type "long long",
668-
"unsigned long long", or "quad" (typically
669-
64-bit integers)
670-
t interpret integer as C type "ptrdiff_t"
671-
z interpret integer as C type "size_t"
659+
=begin table
660+
661+
hh | interpret integer as C type "char" or "unsigned char"
662+
h | interpret integer as C type "short" or "unsigned short"
663+
j | interpret integer as C type "intmax_t", only with a C99 compiler (unportable)
664+
l | interpret integer as C type "long" or "unsigned long"
665+
q, L, or ll | interpret integer as C type "long long", "unsigned long long", or "quad" (typically 64-bit integers)
666+
t | interpret integer as C type "ptrdiff_t"
667+
z | interpret integer as C type "size_t"
668+
=end table
672669
673670
B<order of arguments>
674671
@@ -689,13 +686,15 @@ So:
689686
uses C<$a> for the width, C<$b> for the precision, and C<$c> as the value to
690687
format; while:
691688
689+
=for code :skip-test
692690
NYI sprintf '<%*1$.*s>', $a, $b;
693691
694692
would use C<$a> for the width and precision and C<$b> as the value to format.
695693
696694
Here are some more examples; be aware that when using an explicit
697695
index, the C<$> may need escaping:
698696
697+
=for code :skip-test
699698
sprintf "%2\$d %d\n", 12, 34; # "34 12\n"
700699
sprintf "%2\$d %d %d\n", 12, 34; # "34 12 34\n"
701700
sprintf "%3\$d %d %d\n", 12, 34, 56; # "56 12 34\n"
@@ -707,13 +706,13 @@ index, the C<$> may need escaping:
707706
Other examples:
708707
709708
=for code :skip-test
710-
NYI sprintf "%ld a big number", 4294967295;
711-
NYI sprintf "%%lld a bigger number", 4294967296;
712-
sprintf('%c', 97); # a
713-
sprintf("%.2f", 1.969); # 1.97
714-
sprintf("%+.3f", 3.141592); # +3.142
715-
sprintf('%2$d %1$d', 12, 34); # 34 12
716-
sprintf("%x", 255); # ff
709+
NYI sprintf "%ld a big number", 4294967295;
710+
NYI sprintf "%%lld a bigger number", 4294967296;
711+
sprintf('%c', 97); # a
712+
sprintf("%.2f", 1.969); # 1.97
713+
sprintf("%+.3f", 3.141592); # +3.142
714+
sprintf('%2$d %1$d', 12, 34); # 34 12
715+
sprintf("%x", 255); # ff
717716
718717
Special case: 'sprintf("<b>%s</b>\n", "Perl 6")' will not work, but
719718
one of the following will:

doc/Type/Sub.pod6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ operators separate the two parts by white space.
2121
# OUTPUT«I love 42!␤»
2222
sub postcircumfix:<⸨ ⸩>(Positional $a, Whatever){ say $a[0], '…', $a[*-1] }
2323
[1,2,3,4]⸨*⸩;
24-
OUTPUT«1…4␤»
24+
# OUTPUT«1…4␤»
2525
constant term:<♥> = "♥"; # We don't want to quote "love", do we?
2626
sub circumfix:<α ω>($a){ say „$a is the beginning and the end.“ };
2727
α♥ω;

doc/Type/X/Proc/Unsuccessful.pod6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
=SUBTITLE Exception thrown if a Proc object is sunk after the process it ran exited unsuccessfully
66
7-
class X::Proc::Unsuccessful is Exception { ... }
7+
class X::Proc::Unsuccessful is Exception {}
88
99
=head1 Methods
1010

0 commit comments

Comments
 (0)