Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Replacing hard tabs with spaces
  • Loading branch information
Paul Cochrane committed Jan 24, 2015
1 parent 470bb4d commit bea39ef
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions lib/Language/classtut.pod
Expand Up @@ -191,9 +191,9 @@ when attribute initialization will be executed because it can be done during
compilation, runtime or both especially when importing class using L<use>
keyword.
class HaveStaticAttr {
my Foo $.foo = some_complicated_subroutine;
}
class HaveStaticAttr {
my Foo $.foo = some_complicated_subroutine;
}
Class attributes may also be declared with secondary sigil like object
attributes that will result in generating read-only accessor if attribute
Expand Down
8 changes: 4 additions & 4 deletions lib/Type/Int.pod
Expand Up @@ -31,15 +31,15 @@ codepoint number and converting it the corresponding character.
=head2 routine expmod
multi sub expmod (Int:D: Int $y, Int $mod) returns Int:D
multi method expmod (Int:D: Int $y, Int $mod) returns Int:D
multi sub expmod (Int:D: Int $y, Int $mod) returns Int:D
multi method expmod (Int:D: Int $y, Int $mod) returns Int:D
Returns the given C<Int> raised to the C<$y> power within modulus C<$mod>.
=head2 routine is-prime
multi sub is-prime (Int:D: Int $tries = 100) returns Bool:D
multi method is-prime (Int:D: Int $tries = 100) returns Bool:D
multi sub is-prime (Int:D: Int $tries = 100) returns Bool:D
multi method is-prime (Int:D: Int $tries = 100) returns Bool:D
Returns C<True> if this C<Int> is known to be a prime, or is likely to be a
prime based on a probabilistic Miller-Rabin test. C<$tries> is the maximal
Expand Down
26 changes: 13 additions & 13 deletions lib/Type/Str.pod
Expand Up @@ -349,26 +349,26 @@ C<s/matcher/replacement>.
C<$matcher> an be a L<Regex>, or a literal C<Str>. Non-Str matcher arguments
of type L<Cool> are coerced to to C<Str> for literal matching.
my $some-string = "Some foo";
my $another-string = $some-string.subst(/foo/, "string"); # gives 'Some string'
$some-string.=subst(/foo/, "string"); # in-place substitution. $some-string is now 'Some string'
my $some-string = "Some foo";
my $another-string = $some-string.subst(/foo/, "string"); # gives 'Some string'
$some-string.=subst(/foo/, "string"); # in-place substitution. $some-string is now 'Some string'
The replacement can be a closure:
my $i = 41;
my $str = "The answer is secret.";
my $real-answer = $str.subst(/secret/, {++$i}); # The answer to everything
my $i = 41;
my $str = "The answer is secret.";
my $real-answer = $str.subst(/secret/, {++$i}); # The answer to everything
Here are other examples of usage:
my $str = "Hey foo foo foo";
$str.subst(/foo/, "bar", :g); # global substitution - returns Hey bar bar bar
$str.subst(/foo/, "no subst", :x(0)); # targeted substitution. Number of times to substitute. Returns back unmodified.
$str.subst(/foo/, "bar", :x(1)); #replace just the first occurrence.
$str.subst(/foo/, "bar", :nth(3)); # replace nth match alone. Replaces the third foo. Returns Hey foo foo bar
my $str = "Hey foo foo foo";
$str.subst(/foo/, "bar", :g); # global substitution - returns Hey bar bar bar
$str.subst(/foo/, "no subst", :x(0)); # targeted substitution. Number of times to substitute. Returns back unmodified.
$str.subst(/foo/, "bar", :x(1)); #replace just the first occurrence.
$str.subst(/foo/, "bar", :nth(3)); # replace nth match alone. Replaces the third foo. Returns Hey foo foo bar
The following adverbs are supported
Expand Down

0 comments on commit bea39ef

Please sign in to comment.