Skip to content

Commit

Permalink
Various text improvements.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmichaud committed Jul 20, 2010
1 parent a366001 commit 6e6ccf8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
13 changes: 7 additions & 6 deletions src/basics.pod
Expand Up @@ -140,12 +140,13 @@ X<method>
X<invocant>

The right-hand side calls a I<method> --a named group of behavior-- named C<get>
on the file handle stored in C<$file>. This method reads and returns one line
from the file, removing the line ending. C<split> is also a method, called on
the string returned from C<get>. C<split>'s single argument is a string
containing a space character. C<split> decomposes its I<invocant>--the string
on which it operates--into a list of strings. It turns the single string C<'Beth Ana Charlie
Dave'> into the list of strings C<'Beth', 'Ana', 'Charlie', 'Dave'>. Finally, this list gets
on the file handle stored in C<$file>. The C<get> method reads and returns
one line from the file, removing the line ending. C<split> is also a method,
called on the string returned from C<get>. C<split>'s single argument is
a string containing a space character. C<split> decomposes its
I<invocant>--the string on which it operates--into a list of strings.
It turns the single string C<'Beth Ana Charlie Dave'> into the list of
strings C<'Beth', 'Ana', 'Charlie', 'Dave'>. Finally, this list gets
stored in the array C<@names>. The C<@> sigil marks the declared variable as
an C<Array>. Arrays store ordered lists.

Expand Down
15 changes: 7 additions & 8 deletions src/operators.pod
Expand Up @@ -74,7 +74,7 @@ could also write the example above as

=end programlisting

Finally, the C<,> operator constructs a C<List>, which is an immutable sequence
Finally, the C<,> operator constructs a C<List>, which is a sequence
of objects. In this case the objects are pairs.

X<infix>
Expand Down Expand Up @@ -137,7 +137,7 @@ the product, and use C<< [<=] >> to check if a list is ordered by ascending
values.

After the C<[max]> you see the expression C<@scores».key».chars>. Just like
C<@variable.method> calls a method on the C<@variable>, C<@array».method>
C<@variable.method> calls a method on C<@variable>, C<@array».method>
calls a method for each item in C<@array>, and returns the list of the return
values.

Expand All @@ -146,8 +146,7 @@ can be entered on most computers
N<Ubuntu 10.4: In System/Preferences/Keyboard/Layouts/Options/Compose Key position
select on of the keys to be the "Compose" key. Then press
Compose-key and the "greater than" key twice.>
If your operating system does not make it easy to write it you can also write it as
>>.
If your operating system does not make it easy to write it you can also write it using two angle brackets (>>).

So C<@scores».key> is a list of all the keys of the pair objects in C<@scores>,
and C<@scores».key».chars> is a list of the length of all keys in C<@scores>.
Expand Down Expand Up @@ -322,10 +321,10 @@ right an integer and so they are not of the same type.

=head2 Numeric Comparisons

You can ask if two objects are the same number with the C<==> infix operator.
If one of the objects is not number, Perl will do its best to convert it to a
number. If there is no good way to convert an object to a number, the default
of C<0> is assumed.
You can ask if two objects have the same numeric value with the C<==> infix
operator. If one of the objects is not numeric, Perl will do its best to
make it numeric before doing the comparison. If there is no good way to
convert an object to a number, the default of C<0> is assumed.

=begin programlisting

Expand Down
4 changes: 2 additions & 2 deletions src/subs-n-sigs.pod
Expand Up @@ -763,8 +763,8 @@ about captures. When you do, Perl 6 allows you to manipulate captures
directly.

Captures have both positional and named parts which act like lists and hashes,
respectively. The list-like parts contain positional parameters and the
hash-like parts contain named parameters.
respectively. The list-like parts contain positional arguments and the
hash-like parts contain named arguments.

=head2 Creating And Using A Capture

Expand Down

0 comments on commit 6e6ccf8

Please sign in to comment.