Skip to content

Commit

Permalink
give examples of incorrect args
Browse files Browse the repository at this point in the history
  • Loading branch information
tbrowder committed Oct 16, 2016
1 parent 2bc0df8 commit f6314f6
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions doc/Language/operators.pod6
Original file line number Diff line number Diff line change
Expand Up @@ -1063,10 +1063,17 @@ X<String repetition operator>.
Coerces C<$a> to L<Str> and C<$b> to L<Int> and repeats the string C<$a> C<$b>
times. Return the empty string if C<< $b <= 0 >>.
say 'ab' x 3; # ababab
say 42 x 3; # 424242
say 'ab' x 3; # ababab
say 42 x 3; # 424242
my $a = 'a'; my $b = 3;
say $a x $b; # aaa
Note there is no warning to the user when C<$b> is coerced to a zero or negative integer.
Note there is currently no warning to the user when C<$b> is coerced to a zero or negative integer:
say 5 x ' '; # ''
say 5 x 'a'; # ''
my $a = 3; my $b = 'a';
say $a x $b; # ''
=head2 infix C«xx»
Expand Down

0 comments on commit f6314f6

Please sign in to comment.