Skip to content

Commit

Permalink
Several small fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
nunorc committed Apr 23, 2010
1 parent e325b80 commit da67c46
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/classes-and-objects.pod
Expand Up @@ -137,7 +137,7 @@ into allomorphism here. Is there a rephrasing that's more correct?
However, this attribute represents an array of items, so it requires the C<@>
sigil. These items each specify a task that must be completed before the
present one can complete. Furthermore, the type declaration on this attribute
indicates that the array may only hold instances of the Task class (or some
indicates that the array may only hold instances of the C<Task> class (or some
subclass of it).

The third attribute represents the state of completion of a task:
Expand Down Expand Up @@ -249,7 +249,7 @@ C<@!dependencies> attribute of the current invocant.
After all of the dependencies have completed, it's time to perform the current
C<Task>'s task by invoking the C<&!callback> attribute directly; this is the
purpose of the parentheses. Finally, the method sets the C<$!done> attribute
to True, so that subsequent invocations of C<perform> on this object (if this
to C<True>, so that subsequent invocations of C<perform> on this object (if this
C<Task> is a dependency of another C<Task>, for example) will not repeat the
task.

Expand Down
8 changes: 4 additions & 4 deletions src/multi-dispatch.pod
Expand Up @@ -141,9 +141,9 @@ this to count how often a type check occurs:
multi a($x where { $counter++; True }) { };

a(3);
say $counter;
say $counter; # says B<0>
a('str');
say $counter;
say $counter; # says B<2>

=end programlisting

Expand Down Expand Up @@ -315,7 +315,7 @@ X<parameters; anonymous>

The only new thing here is that the parameters don't have names. The bodies of
the subroutines do not use them, so there's no reason to force the programmer
to name them. A C<$> in a signature stands for a single, anonymous scalar
to name them. A single C<$> in a signature stands for an anonymous scalar
variable.

X<types; capture>
Expand Down Expand Up @@ -455,7 +455,7 @@ latter by installing a I<proto> routine:
Nearly all Perl 6 built-in functions and operators export a proto definition,
which prevents accidental overriding of built-insN<One of the very rare
exceptions is the smart match operator C<< infix:<~~> >> which is not easily
overloadable. Instead it redispatches to overloadable multi methods.>>.
overloadable. Instead it redispatches to overloadable multi methods.>.

=begin sidebar

Expand Down
4 changes: 2 additions & 2 deletions src/regexes.pod
Expand Up @@ -663,8 +663,8 @@ X<subst>
X<substitutions>

Regexes are not only popular for data validation and extraction, but also data
manipulation. The C<subst> method matches a regex against a string. If it
finds a match is found, it substitutes the portion of the string that matches
manipulation. The C<subst> method matches a regex against a string. If
a match is found, it substitutes the portion of the string that matches
with its second argument.

=begin programlisting
Expand Down
8 changes: 4 additions & 4 deletions src/subs-n-sigs.pod
Expand Up @@ -86,7 +86,7 @@ both of these areas, allowing you to constrain the values that may be passed in
a whole range of ways and also to dig into data structures and extract the parts
that are of interest.

=head2 The basics
=head2 The Basics

In its most simple form, a signature is a comma separated list of variable names
that incoming arguments should be bound to.
Expand All @@ -109,7 +109,7 @@ too limiting, then you have two different ways to relax this restriction.

Marking a parameter as C<is rw> means that you are allowed to modify the
argument that was passed in. Doing so modifies the original thing that was
passed. If a literal or some other constant value was passed in for an rw
passed. If a literal or some other constant value was passed in for an C<rw>
parameter, then binding of the signature fails, and the subroutine cannot be
called with the constant argument.

Expand Down Expand Up @@ -198,7 +198,7 @@ may be bound to it, even if it could be bound to one of the other sigils too.
Sometimes you want to fill positional arguments from an array. Instead of
writing C<eat(@food[0], @food[1], @food[2], ...)> and so on for every array
item, you can I<interpolate> it into the argument list by prepending a
vertical bar: C<eat(@food)>.
vertical bar: C<eat(|@food)>.

Likewise hashes can be interpolated into named arguments:

Expand Down Expand Up @@ -358,7 +358,7 @@ to the function:

=end programlisting

The asterisk in front of an array parameter marks it as I<slurpy>. It takes
An asterisk C<*> preceding an array parameter marks it as I<slurpy>. It takes
all remaining positional arguments and stores them in an array.

Likewise C<*%hash> slurps all the remaining named arguments into an array.
Expand Down

0 comments on commit da67c46

Please sign in to comment.