Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[Spec]reverted \x20 to \xC2A0. "Perl 6" and "Perl 5" are words, so we…

… don't want to break between the l and the digit, and it doesn't ever render as Perl\n6. [particle]++ and moritz_++ for explanation.

git-svn-id: http://svn.pugscode.org/pugs@27893 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
commit ea2a00022f18cdc01721fd34c6e697098de6abc3 1 parent 65245e4
jimmy authored
View
38 S01-overview.pod
@@ -19,14 +19,14 @@ Synopsis 1: Overview
This document originally summarized Apocalypse 1, which covers the
initial design concept. That original summary may be found below
under "Random Thoughts". However, these Synopses also contain
-updates to reflect the evolving design of Perl 6 over time, unlike
+updates to reflect the evolving design of Perl 6 over time, unlike
the Apocalypses, which are frozen in time as "historical documents".
These updates are not marked--if a Synopsis disagrees with its
Apocalypse, assume the Synopsis is correct.
Another assumption has been that if we don't talk about something in these
-Synopses, it's the same as it is in Perl 5. Soon we plan to fill in
-the gaps with the Perl 5 details though.
+Synopses, it's the same as it is in Perl 5. Soon we plan to fill in
+the gaps with the Perl 5 details though.
=head1 Project Plan
@@ -36,19 +36,19 @@ working on various bits and pieces as they see fit, since this is
primarily a volunteer effort.
This document does not attempt to summarize all these subprojects--see
-the various websites for Parrot and Pugs and Perl 6 for such
+the various websites for Parrot and Pugs and Perl 6 for such
information. What we can say here is that, unlike how it was with
-Perl 5, none of these projects is designed to be the Official Perl.
-Perl 6 is anything that passes the official test suite. This test
+Perl 5, none of these projects is designed to be the Official Perl.
+Perl 6 is anything that passes the official test suite. This test
suite was initially developed under the Pugs project because that
project is the furthest along in exploring the high-level semantics
-of Perl 6. (Other projects are better at other things, such as speed
+of Perl 6. (Other projects are better at other things, such as speed
or interoperability.) However, the Pugs project views the test suite
as community property, and is working towards platform neutrality,
-so that Perl 6 is defined primarily by its desired semantics, not by
+so that Perl 6 is defined primarily by its desired semantics, not by
accidents of history.
-Another aspect of this is the Perl 6 compiler will be self-hosting.
+Another aspect of this is the Perl 6 compiler will be self-hosting.
That is, the compiler will eventually compile itself, at least down
to the point where various code-generating backends can take over.
This largely removes platform dependencies from the frontend, so that
@@ -81,7 +81,7 @@ Larry's First Law of Language Redesign: Everyone wants the colon.
RFCs are rated on "PSA": whether they point out a real Problem,
whether they present a viable Solution, and whether that solution is
-likely to be Accepted as part of Perl 6.
+likely to be Accepted as part of Perl 6.
=item *
@@ -90,8 +90,8 @@ present the language to a new user.
=item *
-Perl 6 should be malleable enough that it can evolve into the imaginary
-perfect language, Perl 7. This darwinian imperative implies support
+Perl 6 should be malleable enough that it can evolve into the imaginary
+perfect language, Perl 7. This darwinian imperative implies support
for multiple syntaxes above and multiple platforms below.
=item *
@@ -103,8 +103,8 @@ language. We are not turning Perl into any other existing language.
=item *
Migration is important. The perl interpreter will assume that it
-is being fed Perl 5 code unless the code starts with a "class" or
-"module" keyword, or you specifically tell it you're running Perl 6
+is being fed Perl 5 code unless the code starts with a "class" or
+"module" keyword, or you specifically tell it you're running Perl 6
code in some other way, such as by:
#!/usr/bin/perl6
@@ -113,8 +113,8 @@ code in some other way, such as by:
=item *
-Migration in the other direction is also important. In Perl 6
-mode, one can drop back to Perl 5 mode with C<use v5> at the
+Migration in the other direction is also important. In Perl 6
+mode, one can drop back to Perl 5 mode with C<use v5> at the
beginning of a lexical block. Such blocks may be nested:
use v6;
@@ -131,8 +131,8 @@ beginning of a lexical block. Such blocks may be nested:
=item *
Scaling is one of those areas where Perl needs to be multiparadigmatic
-and context sensitive. Perl 5 code is not strict by default, while
-Perl 6 code is. But it should be easy to relax with C<-e> or
+and context sensitive. Perl 5 code is not strict by default, while
+Perl 6 code is. But it should be easy to relax with C<-e> or
a bare version number:
perl -e '$x = 1'
@@ -147,7 +147,7 @@ modules on the user's behalf.
=item *
-If you want to treat everything as objects in Perl 6, Perl will help
+If you want to treat everything as objects in Perl 6, Perl will help
you do that. If you don't want to treat everything as objects, Perl
will help you with that viewpoint as well.
View
98 S02-bits.pod
@@ -18,7 +18,7 @@ Synopsis 2: Bits and Pieces
This document summarizes Apocalypse 2, which covers small-scale
lexical items and typological issues. (These Synopses also contain
-updates to reflect the evolving design of Perl 6 over time, unlike the
+updates to reflect the evolving design of Perl 6 over time, unlike the
Apocalypses, which are frozen in time as "historical documents".
These updates are not marked--if a Synopsis disagrees with its
Apocalypse, assume the Synopsis is correct.)
@@ -93,7 +93,7 @@ not C<U+298E>. Neither C<U+298E> nor C<U+2990> are valid bracket
openers, despite having reverse mappings in the BidiMirroring table.
The C<U+301D> codepoint has two closing alternatives, C<U+301E> and C<U+301F>;
-Perl 6 only recognizes the one with lower code point number, C<U+301E>,
+Perl 6 only recognizes the one with lower code point number, C<U+301E>,
as the closing brace. This policy also applies to new one-to-many
mappings introduced in the future.
@@ -113,8 +113,8 @@ that construct.
=item *
-POD sections may be used reliably as multiline comments in Perl 6.
-Unlike in Perl 5, POD syntax now lets you use C<=begin comment>
+POD sections may be used reliably as multiline comments in Perl 6.
+Unlike in Perl 5, POD syntax now lets you use C<=begin comment>
and C<=end comment> delimit a POD block correctly without the need
for C<=cut>. (In fact, C<=cut> is now gone.) The format name does
not have to be C<comment> -- any unrecognized format name will do
@@ -139,9 +139,9 @@ comments require the C<#> to be followed by one
or more opening bracketing characters.
All other uses of C<#> are interpreted as single-line comments that
-work just as in Perl 5, starting with a C<#> character and
+work just as in Perl 5, starting with a C<#> character and
ending at the subsequent newline. They count as whitespace equivalent
-to newline for purposes of separation. Unlike in Perl 5, C<#>
+to newline for purposes of separation. Unlike in Perl 5, C<#>
may I<not> be used as the delimiter in quoting constructs.
=item *
@@ -228,7 +228,7 @@ C<m>, C<s>, C<tr>, and C<rx>) enable subsequent user-selected brackets.
Some languages such as C allow you to escape newline characters
to combine lines. Other languages (such as regexes) allow you to
-backslash a space character for various reasons. Perl 6 generalizes
+backslash a space character for various reasons. Perl 6 generalizes
this notion to any kind of whitespace. Any contiguous whitespace
(including comments) may be hidden from the parser by prefixing it
with C<\>. This is known as the "unspace". An unspace can suppress
@@ -332,16 +332,16 @@ to mean the other thing.
=item *
-In general, whitespace is optional in Perl 6 except where it is needed
+In general, whitespace is optional in Perl 6 except where it is needed
to separate constructs that would be misconstrued as a single token or
-other syntactic unit. (In other words, Perl 6 follows the standard
+other syntactic unit. (In other words, Perl 6 follows the standard
I<longest-token> principle, or in the cases of large constructs, a
I<prefer shifting to reducing> principle. See L</Grammatical Categories>
below for more on how a Perl program is analyzed into tokens.)
This is an unchanging deep rule, but the surface ramifications of it
change as various operators and macros are added to or removed from
-the language, which we expect to happen because Perl 6 is designed to
+the language, which we expect to happen because Perl 6 is designed to
be a mutable language. In particular, there is a natural conflict
between postfix operators and infix operators, either of which
may occur after a term. If a given token may be interpreted as
@@ -449,7 +449,7 @@ calls, even for attributes.
=item *
-Perl 6 has an optional type system that helps you write safer
+Perl 6 has an optional type system that helps you write safer
code that performs better. The compiler is free to infer what type
information it can from the types you supply, but will not complain
about missing type information unless you ask it to.
@@ -477,7 +477,7 @@ classes are not considered immutable.
=item *
-Perl 6 supports the notion of B<properties> on various kinds of
+Perl 6 supports the notion of B<properties> on various kinds of
objects. Properties are like object attributes, except that they're
managed by the individual object rather than by the object's class.
@@ -495,10 +495,10 @@ mixin instead, so that the compiler can optimize based on declared traits.
=item *
-Perl 6 is an OO engine, but you're not generally required to think
+Perl 6 is an OO engine, but you're not generally required to think
in OO when that's inconvenient. However, some built-in concepts such
as filehandles will be more object-oriented in a user-visible way
-than in Perl 5.
+than in Perl 5.
=item *
@@ -566,7 +566,7 @@ If you say
you are declaring that the elements of C<@array> are native integers,
but that the array itself is implemented by the C<MyArray> class.
Untyped arrays and hashes are still perfectly acceptable, but have
-the same performance issues they have in Perl 5.
+the same performance issues they have in Perl 5.
=item *
@@ -649,7 +649,7 @@ is defined:
=item *
-Perl 6 intrinsically supports big integers and rationals through its
+Perl 6 intrinsically supports big integers and rationals through its
system of type declarations. C<Int> automatically supports promotion
to arbitrary precision, as well as holding C<Inf> and C<NaN> values.
Note that C<Int> assumes 2's complement arithmetic, so C<+^1 == -2>
@@ -678,7 +678,7 @@ rather than C<int> and C<num>.
=item *
-Perl 6 should by default make standard IEEE floating point concepts
+Perl 6 should by default make standard IEEE floating point concepts
visible, such as C<Inf> (infinity) and C<NaN> (not a number). Within a
lexical scope, pragmas may specify the nature of temporary values,
and how floating point is to behave under various circumstances.
@@ -835,7 +835,7 @@ gives you everything it can in that argument position. For instance:
@slice = %x{*;'foo'}; # any keys in domain of 1st dimension
@array[*] # flattens, unlike @array[]
(*, *, $x) = (1, 2, 3); # skip first two elements
- # (same as lvalue "undef" in Perl 5)
+ # (same as lvalue "undef" in Perl 5)
C<Whatever> is an undefined prototype object derived from C<Any>. As a
type it is abstract, and may not be instantiated as a defined object.
@@ -1171,8 +1171,8 @@ given as a trait of the variable:
my $spot is PersistentScalar;
my $spot is DataBase;
-Defining an implementation type is the Perl 6 equivalent to tying
-a variable in Perl 5. But Perl 6 variables are tied directly at
+Defining an implementation type is the Perl 6 equivalent to tying
+a variable in Perl 5. But Perl 6 variables are tied directly at
declaration time, and for performance reasons may not be tied with a
run-time C<tie> statement unless the variable is explicitly declared
with an implementation type that does the C<Tieable> role.
@@ -1369,7 +1369,7 @@ The C<$Package'var> syntax is gone. Use C<$Package::var> instead.
=item *
-Perl 6 includes a system of B<sigils> to mark the fundamental
+Perl 6 includes a system of B<sigils> to mark the fundamental
structural type of a variable:
$ scalar (object)
@@ -1453,7 +1453,7 @@ original object.
=item *
-Unlike in Perl 5, you may no longer put whitespace between a sigil
+Unlike in Perl 5, you may no longer put whitespace between a sigil
and its following name or construct.
=item *
@@ -1499,7 +1499,7 @@ are any elements in the container.
=item *
To get a Perlish representation of any object, use the C<.perl> method.
-Like the C<Data::Dumper> module in Perl 5, the C<.perl> method will put
+Like the C<Data::Dumper> module in Perl 5, the C<.perl> method will put
quotes around strings, square brackets around list values, curlies around
hash values, constructors around objects, etc., so that Perl can evaluate
the result back to the same object. The C<.perl> method will return
@@ -1579,7 +1579,7 @@ But note that these don't do the same thing:
=item *
There is a need to distinguish list assignment from list binding.
-List assignment works much like it does in Perl 5, copying the
+List assignment works much like it does in Perl 5, copying the
values. There's a new C<:=> binding operator that lets you bind
names to C<Array> and C<Hash> objects without copying, in the same way
as subroutine arguments are bound to formal parameters. See S06
@@ -1643,11 +1643,11 @@ parentheses. The special syntax form C<$()> translates into C<$( $.ast // Str($
to operate on the current match object; similarly C<@()> and C<%()> can
extract positional and named submatches.
-C<Capture> objects fill the ecological niche of references in Perl 6.
+C<Capture> objects fill the ecological niche of references in Perl 6.
You can think of them as "fat" references, that is, references that
can capture not only the current identity of a single object, but
also the relative identities of several related objects. Conversely,
-you can think of Perl 5 references as a degenerate form of C<Capture>
+you can think of Perl 5 references as a degenerate form of C<Capture>
when you want to refer only to a single item.
=item *
@@ -1672,7 +1672,7 @@ in parentheses:
=item *
-Unlike in Perl 5, the notation C<&foo> merely stands for the C<foo>
+Unlike in Perl 5, the notation C<&foo> merely stands for the C<foo>
function as a C<Routine> object without calling it. You may call any Code
object by dereferencing it with parens (which may, of course, contain arguments):
@@ -1785,7 +1785,7 @@ In numeric context (i.e. when cast into C<Int> or C<Num>), a C<Hash> object
becomes the number of pairs contained in the hash. In a boolean context, a
Hash object is true if there are any pairs in the hash. In either case,
any intrinsic iterator would be reset. (If hashes do carry an intrinsic
-iterator (as they do in Perl 5), there will be a C<.reset> method on the
+iterator (as they do in Perl 5), there will be a C<.reset> method on the
hash object to reset the iterator explicitly.)
=item *
@@ -1796,7 +1796,7 @@ elements, then the second elements, etc. For more on C<sort> see S29.
=item *
-Many of the special variables of Perl 5 are going away. Those that
+Many of the special variables of Perl 5 are going away. Those that
apply to some object such as a filehandle will instead be attributes
of the appropriate object. Those that are truly global will have
global alphabetic names, such as C<$*PID> or C<@*ARGS>.
@@ -1847,7 +1847,7 @@ C<::()> can also be used to introduce an interpolation (see below).
Also, in the absence of another sigil, C<::> can serve as its own
sigil indicating intentional use of a not-yet-declared package name.
-Unlike in Perl 5, if a sigil is followed by comma, semicolon, a colon
+Unlike in Perl 5, if a sigil is followed by comma, semicolon, a colon
not followed by an identifier,
or any kind of bracket or whitespace (including Unicode brackets and
whitespace), it will be taken to be a sigil without a name rather
@@ -1876,7 +1876,7 @@ will result in the message, "Anonymous variable requires declarator".
=item *
-Ordinary package-qualified names look like in Perl 5:
+Ordinary package-qualified names look like in Perl 5:
$Foo::Bar::baz # the $baz variable in package Foo::Bar
@@ -2002,7 +2002,7 @@ Most symbolic references are done with this notation:
$::($foo)::Bar::baz # $Bar::Bar::baz
$::($foobar)baz # ILLEGAL at compile time (no operator baz)
-Note that unlike in Perl 5, initial C<::> doesn't imply global.
+Note that unlike in Perl 5, initial C<::> doesn't imply global.
Package names are searched for from inner lexical scopes to outer,
then from inner packages to outer. Variable names are searched
for from inner lexical scopes to outer, but unlike package names
@@ -2542,7 +2542,7 @@ forms (including the * form, since constant folding is not available
to the run time). Also allowed in strings are leading plus or minus,
and maybe a trailing Units type for an implied scaling. Leading and
trailing whitespace is ignored. Note also that leading C<0> by itself
-I<never> implies octal in Perl 6.
+I<never> implies octal in Perl 6.
Any of the adverbial forms may be used as a function:
@@ -2625,7 +2625,7 @@ To force a single value to become a list object in item context,
you should use C<< ['a'] >> for clarity as well as correctness.
The degenerate case C<< <> >> is disallowed as a probable attempt to
-do IO in the style of Perl 5; that is now written C<lines()>. (C<<
+do IO in the style of Perl 5; that is now written C<lines()>. (C<<
<STDIN> >> is also disallowed.) Empty lists are better written with
C<()> or C<Nil> in any case because C<< <> >> will often be misread
as meaning C<('')>. (Likewise the subscript form C<< %foo<> >>
@@ -2785,7 +2785,7 @@ The other forms of adverb (including the bare C<:a> form) I<always>
look for an immediate bracketed argument, and will slurp it up.
If that's not intended, you must use whitespace between the adverb and
the opening bracket. The syntax of individual adverbs is the same
-everywhere in Perl 6. There are no exceptions based on whether an
+everywhere in Perl 6. There are no exceptions based on whether an
argument is wanted or not. (There is a minor exception for quote and
regex adverbs, which accept I<only> parentheses as their bracketing
operator, and ignore other brackets, which must be placed in parens
@@ -2960,7 +2960,7 @@ with empty brackets:
Note that this fixes the spurious "C<@>" problem in double-quoted email addresses.
-As with Perl 5 array interpolation, the elements are separated by a space.
+As with Perl 5 array interpolation, the elements are separated by a space.
(Except that a space is not added if the element already ends in some kind
of whitespace. In particular, a list of pairs will interpolate with a
tab between the key and value, and a newline after the pair.)
@@ -3207,7 +3207,7 @@ counting algorithms...)
=item *
-There are no barewords in Perl 6. An undeclared bare identifier will
+There are no barewords in Perl 6. An undeclared bare identifier will
always be taken to mean a subroutine name. (Class names
(and other type names) are predeclared, or prefixed with the C<::>
type sigil when you're declaring a new one.) A consequence of this
@@ -3341,7 +3341,7 @@ objects in a pinch.)
=item *
-There is no hash subscript autoquoting in Perl 6. Use C<< %x<foo> >>
+There is no hash subscript autoquoting in Perl 6. Use C<< %x<foo> >>
for constant hash subscripts, or the old standby C<< %x{'foo'} >>. (It
also works to say C<%x«foo»> as long as you realized it's subject to
interpolation.)
@@ -3356,7 +3356,7 @@ subject to keyword or even macro interpretation. If you say
}
then C<$x> ends up containing the pair C<< ("if" => 1) >>. Always.
-(Unlike in Perl 5, where version numbers didn't autoquote.)
+(Unlike in Perl 5, where version numbers didn't autoquote.)
You can also use the :key($value) form to quote the keys of option
pairs. To align values of option pairs, you may use the
@@ -3448,15 +3448,15 @@ match at the beginning of any whitespace.)
There are two possible ways to parse heredocs. One is to look ahead
for the newline and grab the lines corresponding to the heredoc, and
-then parse the rest of the original line. This is how Perl 5 does it.
-Unfortunately this suffers from the problem pervasive in Perl 5 of
+then parse the rest of the original line. This is how Perl 5 does it.
+Unfortunately this suffers from the problem pervasive in Perl 5 of
multi-pass parsing, which is masked somewhat because there's no way
-to hide a newline in Perl 5. In Perl 6, however, we can use "unspace"
+to hide a newline in Perl 5. In Perl 6, however, we can use "unspace"
to hide a newline, which means that an algorithm looking ahead to find
the newline must do a full parse (with possible untoward side effects)
in order to locate the newline.
-Instead, Perl 6 takes the one-pass approach, and just lazily queues
+Instead, Perl 6 takes the one-pass approach, and just lazily queues
up the heredocs it finds in a line, and waits until it sees a "real"
newline to look for the text and attach it to the appropriate heredoc.
The downside of this approach is a slight restriction--you may not use
@@ -3571,7 +3571,7 @@ containers (such as slice and hash context; see S03 for details).
=item *
-Unlike in Perl 5, objects are no longer always considered true.
+Unlike in Perl 5, objects are no longer always considered true.
It depends on the state of their C<.Bool> property. Classes get to decide
which of their values are true and which are false. Individual objects
can override the class definition:
@@ -3612,7 +3612,7 @@ the separate C<.defined> method is always there if you need it.
=item *
-List context in Perl 6 is by default lazy. This means a list can
+List context in Perl 6 is by default lazy. This means a list can
contain infinite generators without blowing up. No flattening happens
to a lazy list until it is bound to the signature of a function or
method at call time (and maybe not even then). We say that such
@@ -3678,7 +3678,7 @@ themselves in any event, which may or may not be lazily flattened.
However, function calls in the argument list can't know their eventual
context because the method hasn't been dispatched yet, so we don't
-know which signature to check against. As in Perl 5, list context
+know which signature to check against. As in Perl 5, list context
is assumed unless you explicitly qualify the argument with an item
context operator.
@@ -3693,13 +3693,13 @@ X<..>
The C<< .. >> operator now constructs a C<Range> object rather than merely
functioning as an operator. Both sides are in item context. Semantically,
the C<Range> acts like a list of its values to the extent possible, but
-does so lazily, unlike Perl 5's eager range operator.
+does so lazily, unlike Perl 5's eager range operator.
=item *
There is no such thing as a hash list context. Assignment to a hash
produces an ordinary list context. You may assign alternating keys
-and values just as in Perl 5. You may also assign lists of C<Pair> objects, in
+and values just as in Perl 5. You may also assign lists of C<Pair> objects, in
which case each pair provides a key and a value. You may, in fact,
mix the two forms, as long as the pairs come when a key is expected.
If you wish to supply a C<Pair> as a key, you must compose an outer C<Pair>
@@ -3782,7 +3782,7 @@ be temporized with C<temp>, or hypotheticalized with C<let>.
=head1 Grammatical Categories
-Lexing in Perl 6 is controlled by a system of grammatical categories.
+Lexing in Perl 6 is controlled by a system of grammatical categories.
At each point in the parse, the lexer knows which subset of the
grammatical categories are possible at that point, and follows the
longest-token rule across all the active grammatical categories.
View
152 S03-operators.pod
@@ -1,9 +1,9 @@
-
+
=encoding utf8
=head1 TITLE
-Synopsis 3: Perl 6 Operators
+Synopsis 3: Perl 6 Operators
=head1 AUTHORS
@@ -19,12 +19,12 @@ Synopsis 3: Perl 6 Operators
=head1 Overview
-For a summary of the changes from Perl 5, see L</Changes to Perl 5 operators>.
+For a summary of the changes from Perl 5, see L</Changes to Perl 5 operators>.
=head1 Operator precedence
-Not counting terms and terminators, Perl 6 has 23 operator precedence
-levels (same as Perl 5, but differently arranged). Here we list the
+Not counting terms and terminators, Perl 6 has 23 operator precedence
+levels (same as Perl 5, but differently arranged). Here we list the
levels from "tightest" to "loosest", along with a few examples of
each level:
@@ -300,7 +300,7 @@ Listop (leftward)
4,3, sort 2,1 # 4,3,1,2
-As in Perl 5, a list operator looks like a term to the expression on
+As in Perl 5, a list operator looks like a term to the expression on
its left, so it binds tighter than comma on the left but looser than
comma on the right--see List prefix precedence below.
@@ -342,7 +342,7 @@ Class-qualified method call
$obj.::Class::meth
$obj.Class::meth # same thing, assuming Class is predeclared
-As in Perl 5, tells the dispatcher which class to start searching from,
+As in Perl 5, tells the dispatcher which class to start searching from,
not the exact method to call.
=item *
@@ -394,7 +394,7 @@ There is specifically no C<< infix:<.> >> operator, so
will always result in a compile-time error indicating the user should
use C<< infix:<~> >> instead. This is to catch an error likely to
-be made by Perl 5 programmers learning Perl 6.
+be made by Perl 5 programmers learning Perl 6.
=back
@@ -407,7 +407,7 @@ to a single mutating object in the same expression may result in undefined
behavior unless some explicit sequencing operator is interposed.
See L</Sequence points>.
-As with all postfix operators in Perl 6, no space is allowed between
+As with all postfix operators in Perl 6, no space is allowed between
a term and its postfix. See S02 for why, and for how to work around the
restriction with an "unspace".
@@ -421,9 +421,9 @@ support the common idiom:
say $x unless %seen{$x}++;
Increment of a C<Str> (in a suitable container) works similarly to
-Perl 5, but is generalized slightly.
+Perl 5, but is generalized slightly.
A scan is made for the final alphanumeric sequence in
-the string that is not preceded by a '.' character. Unlike in Perl 5, this
+the string that is not preceded by a '.' character. Unlike in Perl 5, this
alphanumeric sequence need not be anchored to the beginning of the
string, nor does it need to begin with an alphabetic character;
the final sequence in the string matching C<< <!after '.'> <rangechar>+ >>
@@ -462,7 +462,7 @@ in such a range, it wraps to the first character of the range and
sends a "carry" to the position left of it, and that position is
then incremented in its own range. If and only if the leftmost
position is exhausted in its range, an additional character of the
-same range is inserted to hold the carry in the same fashion as Perl 5,
+same range is inserted to hold the carry in the same fashion as Perl 5,
so incrementing '(zz99)' turns into '(aaa00)' and incrementing
'(99zz)' turns into '(100aa)'.
@@ -513,7 +513,7 @@ which portion of the string to increment. Note also that all character
increments can be handled by lookup in a single table of successors
since we've defined our ranges not to include overlapping cycles.)
-Perl 6 also supports C<Str> decrement with similar semantics, simply by
+Perl 6 also supports C<Str> decrement with similar semantics, simply by
running the cycles the other direction. However, leftmost characters
are never removed, and the decrement fails when you reach a string like
"aaa" or "000".
@@ -609,8 +609,8 @@ C<< prefix:<+> >>, numeric context
+$x
-Unlike in Perl 5, where C<+> is a no-op, this operator coerces to
-numeric context in Perl 6. (It coerces only the value, not the
+Unlike in Perl 5, where C<+> is a no-op, this operator coerces to
+numeric context in Perl 6. (It coerces only the value, not the
original variable.) For values that are not already considered
numeric, the narrowest appropriate type of C<Int>, C<Num>, or
C<Complex> will be returned; however, string containing two integers
@@ -884,7 +884,7 @@ string value the number of times specified by the right argument and
returns the result as a single concatenated string regardless of context.
If the count is less than 1, returns the null string.
-The count may not be C<*> because Perl 6 does not support
+The count may not be C<*> because Perl 6 does not support
infinite strings. (At least, not yet...) Note, however, that an
infinite string may be emulated with C<cat($string xx *)>.
@@ -975,8 +975,8 @@ Functions of one argument
sin
... # see S29 Functions
-Note that, unlike in Perl 5, you must use the C<.meth> forms to default
-to C<$_> in Perl 6.
+Note that, unlike in Perl 5, you must use the C<.meth> forms to default
+to C<$_> in Perl 6.
There is no unary C<rand> prefix in Perl 6, though there is a C<.rand>
method call and an argumentless C<rand> term. There is no unary C<int>
@@ -1083,7 +1083,7 @@ C<< infix:<==> >> etc.
== != < <= > >=
-As in Perl 5, converts to C<Num> before comparison. C<!=> is short for C<!==>.
+As in Perl 5, converts to C<Num> before comparison. C<!=> is short for C<!==>.
=item *
@@ -1091,7 +1091,7 @@ C<< infix:<eq> >> etc.
eq ne lt le gt ge
-As in Perl 5, converts to C<Str> before comparison. C<ne> is short for C<!eq>.
+As in Perl 5, converts to C<Str> before comparison. C<ne> is short for C<!eq>.
=item *
@@ -1106,10 +1106,10 @@ Smart match
$obj ~~ $pattern
-Perl 5's C<=~> becomes the "smart match" operator C<~~>, with an
+Perl 5's C<=~> becomes the "smart match" operator C<~~>, with an
extended set of semantics. See L</Smart matching> for details.
-To catch "brainos", the Perl 6 parser defines an C<< infix:<=~> >>
+To catch "brainos", the Perl 6 parser defines an C<< infix:<=~> >>
operator which always fails at compile time with a message directing
the user to use C<~~> or C<~=> (string append) instead if they meant
it as a single operator, or to put a space between if they really
@@ -1145,7 +1145,7 @@ Canonical equivalence
Compares two objects for canonical equivalence. For value types compares
the values. For object types, compares current contents according to some
scheme of canonicalization. These semantics are those used by hashes
-that allow only values for keys (such as Perl 5 string-key hashes).
+that allow only values for keys (such as Perl 5 string-key hashes).
See also L</Comparison semantics>.
=item *
@@ -1320,7 +1320,7 @@ The best don't-repeat-yourself solution is simply:
C<< infix:<?> >>
To catch likely errors by people familiar with C-derived languages
-(including Perl 5), a bare question mark in infix position will
+(including Perl 5), a bare question mark in infix position will
produce an error suggesting that the user use C<?? !!> instead.
=item *
@@ -1411,7 +1411,7 @@ C<< infix:<:=> >>, run-time binding
$signature := $capture
-A new form of assignment is present in Perl 6, called I<binding>, used in
+A new form of assignment is present in Perl 6, called I<binding>, used in
place of typeglob assignment. It is performed with the C<:=> operator.
Instead of replacing the value in a container like normal assignment, it
replaces the container itself. For instance:
@@ -1420,7 +1420,7 @@ replaces the container itself. For instance:
my $y := $x;
$y = 'Perl Hacker';
-After this, both C<$x> and C<$y> contain the string C<"Perl Hacker">,
+After this, both C<$x> and C<$y> contain the string C<"Perl Hacker">,
since they are really just two different names for the same variable.
There is also an identity test, C<=:=>, which tests whether two names
@@ -1461,7 +1461,7 @@ a C<Pair> object that can, among other things, be used to pass named
arguments to functions. It provides item context to both sides.
It does not actually do an assignment except in a notional sense;
however its precedence is now equivalent to assignment, and it is
-also right associative. Note that, unlike in Perl 5, C<< => >>
+also right associative. Note that, unlike in Perl 5, C<< => >>
binds tighter than comma.
=item *
@@ -1502,25 +1502,25 @@ C<< infix:<,> >>, the argument separator
1, 2, 3, @many
-Unlike in Perl 5, comma operator never returns the last value. (In item
+Unlike in Perl 5, comma operator never returns the last value. (In item
context it returns a list instead.)
=item *
-C<< infix:«p5=>» >>, the Perl 5 fatarrow
+C<< infix:«p5=>» >>, the Perl 5 fatarrow
-This operator, which behaves exactly like the Perl 5 fatarrow in being
-equivalent to a comma, is purely for easier migration from Perl 5
-to Perl 6. It is not intended for use by programmers in fresh code;
-it is for use by the p5-to-p6 translator to preserve Perl 5 argument
+This operator, which behaves exactly like the Perl 5 fatarrow in being
+equivalent to a comma, is purely for easier migration from Perl 5
+to Perl 6. It is not intended for use by programmers in fresh code;
+it is for use by the p5-to-p6 translator to preserve Perl 5 argument
passing semantics without losing the intent of the notation.
This operator is purposefully ugly and easy to search for. Note that,
since the operator is equivalent to a comma, arguments come in as
positional pairs rather than named arguments. Hence, if you have
-a Perl 5 sub that manually handles named argument processing by
+a Perl 5 sub that manually handles named argument processing by
assigning to a hash, it will continue to work. If, however, you edit
-the C<< p5=> >> operator in an argument list to Perl 6's C<< => >>
+the C<< p5=> >> operator in an argument list to Perl 6's C<< => >>
operator, it becomes a real named argument, so you must also change
the called sub to handle real named args, since the named pair will no
longer come in via C<@_>. You can either name your formal parameters
@@ -1950,7 +1950,7 @@ The C<item> contextualizer
item foo()
-The new name for Perl 5's C<scalar> contextualizer. Equivalent to C<$(...)>
+The new name for Perl 5's C<scalar> contextualizer. Equivalent to C<$(...)>
(except that empty C<$()> means C<$<?> // Str($/)>, while empty C<item()> yields C<Failure>).
We still call the values scalars, and talk about "scalar operators", but
scalar operators are those that put their arguments into item context.
@@ -1981,7 +1981,7 @@ The C<slice> contextualizer
slice foo()
Forces the subsequent expression to be evaluated in slice context.
-(Slices are considered to be potentially multidimensional in Perl 6.)
+(Slices are considered to be potentially multidimensional in Perl 6.)
A list of C<Capture>s will be transformed into a list of lists.
Equivalent to C<@@(...)> (except that empty C<@@()> means C<@@($/)>, while
empty C<slice()> means a null slice).
@@ -2179,7 +2179,7 @@ followed by the comma operator.
=back
-=head1 Changes to Perl 5 operators
+=head1 Changes to Perl 5 operators
Several operators have been given new names to increase clarity and better
Huffman-code the language, while others have changed precedence.
@@ -2188,9 +2188,9 @@ Huffman-code the language, while others have changed precedence.
=item *
-Perl 5's C<${...}>, C<@{...}>, C<%{...}>, etc. dereferencing
+Perl 5's C<${...}>, C<@{...}>, C<%{...}>, etc. dereferencing
forms are now C<$(...)>, C<@(...)>, C<%(...)>, etc. instead.
-(Use of the Perl 5 curly forms will result in an error message
+(Use of the Perl 5 curly forms will result in an error message
pointing the user to the new forms.)
As in Perl 5, the parens may be dropped when dereferencing
a scalar variable.
@@ -2199,8 +2199,8 @@ a scalar variable.
C<< -> >> becomes C<.>, like the rest of the world uses. There is
a pseudo C<< postfix:{'->'} >> operator that produces a compile-time
-error reminding Perl 5 users to use dot instead. (The "pointy block"
-use of C<< -> >> in Perl 5 requires preceding whitespace when the arrow
+error reminding Perl 5 users to use dot instead. (The "pointy block"
+use of C<< -> >> in Perl 5 requires preceding whitespace when the arrow
could be confused with a postfix, that is when an infix is expected.
Preceding whitespace is not required in term position.)
@@ -2268,7 +2268,7 @@ though that's a silly example since you could just write:
But that demonstrates the other advantage of the method form, which is
that it allows the "unary dot" syntax to test the current topic.
-Unlike in earlier versions of Perl 6, these filetest methods do not return
+Unlike in earlier versions of Perl 6, these filetest methods do not return
stat buffers, but simple scalars of type C<Bool>, C<Int>, or C<Num>.
In general, the user need not worry about caching the stat buffer
@@ -2280,7 +2280,7 @@ object that will not be subject to timeout, and may be tested
repeatedly just as a filename or handle can. An C<IO> object has
a C<.file> method that can be queried for its filename (if known).
-(Inadvertent use of the Perl 5 forms will normally result in treatment
+(Inadvertent use of the Perl 5 forms will normally result in treatment
as a negated postdeclared subroutine, which is likely to produce an
error message at the end of compilation.)
@@ -2306,12 +2306,12 @@ Writing C<$object.'='> will call your prefix operator.
Unary C<~> now imposes a string (C<Str>) context on its
argument, and C<+> imposes a numeric (C<Num>) context (as opposed
-to being a no-op in Perl 5). Along the same lines, C<?> imposes
+to being a no-op in Perl 5). Along the same lines, C<?> imposes
a boolean (C<Bool>) context, and the C<|> unary operator imposes
a function-arguments (C<Capture>) context on its argument.
Unary sigils are allowed when followed by a C<$> sigil on a scalar variable;
they impose the container context implied by their sigil.
-As with Perl 5, however, C<$$foo[bar]> parses as C<( $($foo) )[bar]>,
+As with Perl 5, however, C<$$foo[bar]> parses as C<( $($foo) )[bar]>,
so you need C<$($foo[bar])> to mean the other way. In other
words, sigils are not really parsed as operators, and you must
use the parenthetical form for anything complicated.
@@ -2319,10 +2319,10 @@ use the parenthetical form for anything complicated.
=item *
Bitwise operators get a data type prefix: C<+>, C<~>, or C<?>.
-For example, Perl 5's C<|> becomes either C<+|> or C<~|> or C<?|>,
+For example, Perl 5's C<|> becomes either C<+|> or C<~|> or C<?|>,
depending on whether the operands are to be treated as numbers,
-strings, or boolean values. Perl 5's left shift C< << > becomes
-C< +< >, and correspondingly with right shift. Perl 5's unary C<~>
+strings, or boolean values. Perl 5's left shift C< << > becomes
+C< +< >, and correspondingly with right shift. Perl 5's unary C<~>
(one's complement) becomes either C<+^> or C<~^> or C<?^>, since a
bitwise NOT is like an exclusive-or against solid ones. Note that
C<?^> is functionally identical to C<!>, but conceptually coerces to
@@ -2392,7 +2392,7 @@ The old C<..> flipflop operator is now done with
C<ff> operator. (C<..> now always produces a C<Range> object
even in item context.) The C<ff> operator may take a caret on
either end to exclude either the beginning or ending. There is
-also a corresponding C<fff> operator with Perl 5's C<...> semantics.
+also a corresponding C<fff> operator with Perl 5's C<...> semantics.
You may say
/foo/ ff *
@@ -2465,7 +2465,7 @@ works as a C programmer would expect. The term on the right of the
C<=> is always evaluated in item context.
The syntactic distinction between item and list assignment is similar
-to the way Perl 5 defines it, but has to be a little different because
+to the way Perl 5 defines it, but has to be a little different because
we can no longer decide the nature of an inner subscript on the basis
of the outer sigil. So instead, item assignment is restricted to
lvalues that are simple scalar variables, and assignment to anything
@@ -2546,9 +2546,9 @@ syntax.
=item *
-List operators are all parsed consistently. As in Perl 5,
+List operators are all parsed consistently. As in Perl 5,
to the left a list operator looks like a term, while to the right it looks like
-an operator that is looser than comma. Unlike in Perl 5, the difference
+an operator that is looser than comma. Unlike in Perl 5, the difference
between the list operator form and the function form is consistently
indicated via whitespace between the list operator and the first
argument. If there is whitespace, it is always a list operator,
@@ -2622,7 +2622,7 @@ Examples:
say foo <$bar+1>,$baz say(foo(<$bar+1>, $baz));
say foo .<$bar+1>,$baz say(foo($_.<$bar+1>, $baz));
-Note that Perl 6 is making a consistent three-way distinction between
+Note that Perl 6 is making a consistent three-way distinction between
term vs postfix vs infix, and will interpret an overloaded character
like C<< < >> accordingly:
@@ -2631,9 +2631,9 @@ like C<< < >> accordingly:
any() < $x (any) < $x # infix
any<a b c> ILLEGAL # stealth postfix
-This will seem unfamiliar and "undwimmy" to Perl 5 programmers, who
+This will seem unfamiliar and "undwimmy" to Perl 5 programmers, who
are used to a grammar that sloppily hardwires a few postfix operators
-at the price of extensibility. Perl 6 chooses instead to mandate a
+at the price of extensibility. Perl 6 chooses instead to mandate a
whitespace dependency in order to gain a completely extensible class
of postfix operators.
@@ -2675,7 +2675,7 @@ as an enum declaration. Such a term never looks for its arguments,
is never considered a list prefix operator, and may not work with
subsequent parentheses because it will be parsed as a function call
instead of the intended term. (The function in question may or
-may not exist.) For example, C<rand> is a simple term in Perl 6
+may not exist.) For example, C<rand> is a simple term in Perl 6
and does not allow parens, because there is no C<rand()> function
(though there's a C<$n.rand> method). Most constant values such as
C<e> and C<pi> are in the same category. After parsing one of these
@@ -2721,7 +2721,7 @@ is guaranteed to insert exactly one boolean value into C<@foo>.
=head1 Junctive operators
C<|>, C<&>, and C<^> are no longer bitwise operators (see
-L</Changes to Perl 5 operators>) but now serve a much higher cause:
+L</Changes to Perl 5 operators>) but now serve a much higher cause:
they are now the junction constructors.
A junction is a single value that is equivalent to multiple values. They
@@ -2785,7 +2785,7 @@ explicit C<.pairs>) to make a junction of pairs.
=item *
-Perl 5's comparison operators are basically unchanged, except that they
+Perl 5's comparison operators are basically unchanged, except that they
can be chained because their precedence is unified.
=item *
@@ -2830,7 +2830,7 @@ If that's not enough flexibility, there is also an C<eqv()> function
that can be passed additional information specifying how you want
canonical values to be generated before comparison. This gives
C<eqv()> the same kind of expressive power as a sort signature.
-(And indeed, the C<cmp> operator from Perl 5 also has a functional
+(And indeed, the C<cmp> operator from Perl 5 also has a functional
analog, C<cmp()>, that takes additional instructions on how to
do 3-way comparisons of the kind that a sorting algorithm wants.)
In particular, a signature passed to C<eqv()> will be bound to the
@@ -2844,7 +2844,7 @@ reverts to standard C<eqv> comparison. (Likewise for C<cmp()>.)
=item *
Binary C<cmp> is no longer the comparison operator that
-forces stringification. Use the C<leg> operator for the old Perl 5
+forces stringification. Use the C<leg> operator for the old Perl 5
C<cmp> semantics. The C<cmp> is just like the C<eqv> above except that
instead of returning C<Bool::False> or C<Bool::True> values it always
returns C<Order::Increase>, C<Order::Same>, or C<Order::Decrease>
@@ -3011,7 +3011,7 @@ Think of log scaling, for instance.
=head1 Chained comparisons
-Perl 6 supports the natural extension to the comparison operators,
+Perl 6 supports the natural extension to the comparison operators,
allowing multiple operands:
if 1 < $a < 100 { say "Good, you picked a number *between* 1 and 100." }
@@ -3033,7 +3033,7 @@ in front of it, or it will be interpreted as a hash subscript instead.
=head1 Smart matching
-Here is the table of smart matches for standard Perl 6
+Here is the table of smart matches for standard Perl 6
(that is, the dialect of Perl in effect at the start of your
compilation unit). Smart matching is generally done on the current
"topic", that is, on C<$_>. In the table below, C<$_> represents the
@@ -3304,7 +3304,7 @@ The primary use of the C<~~> operator is to return a boolean value in
a boolean context. However, for certain operands such as regular
expressions, use of the operator within item or list context transfers
the context to that operand, so that, for instance, a regular expression
-can return a list of matched substrings, as in Perl 5. This is done
+can return a list of matched substrings, as in Perl 5. This is done
by returning an object that can return a list in list context, or that
can return a boolean in a boolean context. In the case regex matching
the C<Match> object is a kind of C<Capture>, which has these capabilities.
@@ -3348,7 +3348,7 @@ matched by regexes or by signatures more or less interchangably.
=head1 Invocant marker
An appended C<:> marks the invocant when using the indirect-object
-syntax for Perl 6 method calls. The following two statements are
+syntax for Perl 6 method calls. The following two statements are
equivalent:
$hacker.feed('Pizza and cola');
@@ -3414,7 +3414,7 @@ more of the (less-than-obvious) details on these two operators.
=head1 Meta operators
-Perl 6's operators have been greatly regularized, for instance, by
+Perl 6's operators have been greatly regularized, for instance, by
consistently prefixing numeric, stringwise, and boolean operators
with C<+>, C<~> and C<?> respectively to indicate whether the bitwise
operation is done on a number, a string, or a single bit.
@@ -3423,7 +3423,7 @@ bitwise C<¬> operator, you'd have to add the C<+¬>, C<~¬>, and C<?¬>
operators yourself. Similarly, the carets that exclude the endpoints
on ranges are there by convention only.
-In contrast to that, Perl 6 has six standard metaoperators for
+In contrast to that, Perl 6 has six standard metaoperators for
turning a given existing operator into a related operator that is
more powerful (or at least differently powerful). These differ from a
mere naming convention in that Perl automatically generates these new
@@ -3603,7 +3603,7 @@ be underdimensioned, you can dwim on both sides:
foo «*»
then you shouldn't worry about it, because unlike previous versions,
-Perl 6 never guesses whether the next thing is a term or operator.
+Perl 6 never guesses whether the next thing is a term or operator.
In this case it is always expecting a term unless C<foo> is predeclared
to be a type or value name.]
@@ -4089,15 +4089,15 @@ container, which in turn depends on which declarator you use).
state $foo = 1; # happens at START time
constant $foo = 1; # happens at BEGIN time
-(Note that the semantics of C<our> are different from Perl 5, where the
+(Note that the semantics of C<our> are different from Perl 5, where the
initialization happens at the same time as a C<my>. To get the same
-effect in Perl 6 you'd have to say "C<(our $foo) = 1;>" instead.)
+effect in Perl 6 you'd have to say "C<(our $foo) = 1;>" instead.)
If you do not initialize a container, it starts out undefined at the
beginning of its natural lifetime. (In other words, you can't use
-the old Perl 5 trick of "C<my $foo if 0>" to get a static variable,
+the old Perl 5 trick of "C<my $foo if 0>" to get a static variable,
because a C<my> variable starts out uninitialized every time through
-in Perl 6 rather than retaining its previous value.) Native integer
+in Perl 6 rather than retaining its previous value.) Native integer
containers that do not support the concept of undefined should be
initialized to 0 instead. (Native floating-point containers are
by default initialized to C<NaN>.) Typed object containers start
@@ -4205,8 +4205,8 @@ These all have their uses and are explained in subsequent Synopses.
=head1 Argument List Interpolating
-Perl 5 forced interpolation of a function's argument list by use of
-the C<&> prefix. That option is no longer available in Perl 6, so
+Perl 5 forced interpolation of a function's argument list by use of
+the C<&> prefix. That option is no longer available in Perl 6, so
instead the C<|> prefix operator serves as an
interpolator, by casting its operand to a C<Capture> object
and inserting the capture's parts into the current argument list.
@@ -4275,7 +4275,7 @@ as well as the C<< <> >>, C<< .<> >>, C<«»>, and C<.«»> constant and
interpolating slice subscripting forms.
The C<|> operator interpolates lazily for C<Array> and C<Range> objects.
-To get an immediate interpolation like Perl 5 does, add the C<eager> list
+To get an immediate interpolation like Perl 5 does, add the C<eager> list
operator:
func(|(1..Inf)); # works fine
@@ -4305,7 +4305,7 @@ its bits at once using the C<< prefix:<|> >> operator:
=head1 Traversing arrays in parallel
-In order to support parallel iteration over multiple arrays, Perl 6
+In order to support parallel iteration over multiple arrays, Perl 6
has a C<zip> function that builds a list of C<Seq> objects from the
elements of two or more arrays. In ordinary list context this behaves
as a list of C<Captures> and automatically flattens.
View
78 S04-control.pod
@@ -28,7 +28,7 @@ context, but closures all work the same on the inside.
Blocks are delimited by curlies, or by the beginning and end of the
current compilation unit (either the current file or the current
-C<eval> string). Unlike in Perl 5, there are (by policy) no implicit
+C<eval> string). Unlike in Perl 5, there are (by policy) no implicit
blocks around standard control structures. (You could write a macro
that violates this, but resist the urge.) Variables that mediate
between an outer statement and an inner block (such as loop variables)
@@ -56,7 +56,7 @@ the enclosing block. Period. Lexicals may not "leak" from a block to any
other external scope (at least, not without some explicit aliasing
action on the part of the block, such as exportation of a symbol
from a module). The "point of declaration" is the moment the compiler
-sees "C<my $foo>", not the end of the statement as in Perl 5, so
+sees "C<my $foo>", not the end of the statement as in Perl 5, so
my $x = $x;
@@ -92,7 +92,7 @@ be detected because it is hidden in an eval, then it is erroneous, since
the C<eval()> compiler might bind to either C<$OUTER::x> or the subsequently
declared "C<my $x>".
-As in Perl 5, "C<our $foo>" introduces a lexically scoped alias for
+As in Perl 5, "C<our $foo>" introduces a lexically scoped alias for
a variable in the current package.
The new C<constant> declarator introduces an "our"-scoped name
@@ -110,13 +110,13 @@ life of the closure, so that it keeps its value from the end of one
call to the beginning of the next. Separate clones of the closure
get separate state variables.
-Perl 5's "C<local>" function has been renamed to C<temp> to better
+Perl 5's "C<local>" function has been renamed to C<temp> to better
reflect what it does. There is also a C<let> function that sets a
hypothetical value. It works exactly like C<temp>, except that the
value will be restored only if the current block exits unsuccessfully.
(See Definition of Success below for more.) C<temp> and C<let> temporize
or hypotheticalize the value or the variable depending on whether you
-do assignment or binding. One other difference from Perl 5 is that
+do assignment or binding. One other difference from Perl 5 is that
the default is not to undefine a variable. So
temp $x;
@@ -125,7 +125,7 @@ causes C<$x> to start with its current value. Use
temp undefine $x;
-to get the Perl 5 behavior.
+to get the Perl 5 behavior.
Note that temporizations that are undone upon scope exit must be
prepared to be redone if a continuation within that scope is taken.
@@ -133,7 +133,7 @@ prepared to be redone if a continuation within that scope is taken.
=head1 The Relationship of Blocks and Statements
The return value of a block is the value of its final statement.
-(This is subtly different from Perl 5's behavior, which was to return
+(This is subtly different from Perl 5's behavior, which was to return
the value of the last expression evaluated, even if that expression
was just a conditional.)
@@ -189,7 +189,7 @@ terminator:
X<if>X<unless>
The C<if> and C<unless> statements work much as they do in
-Perl 5. However, you may omit the parentheses on the conditional:
+Perl 5. However, you may omit the parentheses on the conditional:
if $foo == 123 {
...
@@ -204,7 +204,7 @@ Perl 5. However, you may omit the parentheses on the conditional:
If the final statement is a conditional which does not execute any
branch, the return value is C<Nil>.
-The C<unless> statement does not allow an C<elsif> or C<else> in Perl 6.
+The C<unless> statement does not allow an C<elsif> or C<else> in Perl 6.
The value of the conditional expression may be optionally bound to
a closure parameter:
@@ -241,7 +241,7 @@ where each call to the block would bind a new invocant for the
C<.waste> method, each of which is likely different from the original
invocant to the C<.haste> method.)
-Conditional statement modifiers work as in Perl 5. So do the
+Conditional statement modifiers work as in Perl 5. So do the
implicit conditionals implied by short-circuit operators. Note though that
the contents of parens or brackets is parsed as a semicolon-separated list of <I>statements</I>,
so you can say:
@@ -254,13 +254,13 @@ and that is equivalent to:
=head1 Loop statements
-Looping statement modifiers are the same as in Perl 5 except that,
+Looping statement modifiers are the same as in Perl 5 except that,
for ease of writing list comprehensions, a looping statement modifier
is allowed to contain a single conditional statement modifier:
@evens = ($_ * 2 if .odd for 0..100);
-Loop modifiers C<next>, C<last>, and C<redo> also work as in Perl 5.
+Loop modifiers C<next>, C<last>, and C<redo> also work as in Perl 5.
However, the labelled forms use method call syntax: C<LABEL.next>, etc.
The C<.next> and C<.last> methods take an optional argument giving
the final value of that loop iteration. So the old C<next LINE>
@@ -300,7 +300,7 @@ a return type of C<Void>.
=head2 The C<while> and C<until> statements
X<while>X<until>
-The C<while> and C<until> statements work as in Perl 5, except that you
+The C<while> and C<until> statements work as in Perl 5, except that you
may leave out the parentheses around the conditional:
while $bar < 100 {
@@ -326,7 +326,7 @@ In particular, we now generally use C<for> to iterate filehandles.
=head2 The C<repeat> statement
X<repeat>X<while>X<next>X<last>X<redo>
-Unlike in Perl 5, applying a statement modifier to a C<do> block is
+Unlike in Perl 5, applying a statement modifier to a C<do> block is
specifically disallowed:
@@ -346,7 +346,7 @@ or equivalently:
...
} until $x >= 10;
-Unlike Perl 5's C<do-while> loop, this is a real loop block now, so
+Unlike Perl 5's C<do-while> loop, this is a real loop block now, so
C<next>, C<last>, and C<redo> work as expected. The loop conditional
on a C<repeat> block is required, so it will be recognized even if you
put it on a line by its own:
@@ -415,7 +415,7 @@ is equivalent to the Cish idiom:
X<for>X<zip>X<Z>X<STDIN>X<$*IN>X<lines>
There is no C<foreach> statement any more. It's always spelled C<for>
-in Perl 6, so it always takes a list as an argument:
+in Perl 6, so it always takes a list as an argument:
for @foo { .print }
@@ -436,11 +436,11 @@ list that can be bound to the corresponding number of parameters:
for @a Z @b -> $a, $b { print "[$a, $b]\n" } # same thing
The list is evaluated lazily by default, so instead of using a C<while>
-to read a file a line at a time as you would in Perl 5:
+to read a file a line at a time as you would in Perl 5:
while (my $line = <STDIN>) {...}
-in Perl 6 you should use a C<for> instead:
+in Perl 6 you should use a C<for> instead:
for $*IN.lines -> $line {...}
@@ -454,11 +454,11 @@ no implicit block scopes.) It is also possible to write
However, this is likely to fail on autochomped filehandles, so use
the C<for> loop instead.
-Note also that Perl 5's special rule causing
+Note also that Perl 5's special rule causing
while (<>) {...}
-to automatically assign to C<$_> is not carried over to Perl 6. That
+to automatically assign to C<$_> is not carried over to Perl 6. That
should now be written:
for lines() {...}
@@ -517,7 +517,7 @@ for C<< statement_control:<for> >> because it always calls a closure.
=head2 The do-once loop
-In Perl 5, a bare block is deemed to be a do-once loop. In Perl 6,
+In Perl 5, a bare block is deemed to be a do-once loop. In Perl 6,
the bare block is not a do-once. Instead C<do {...}> is the do-once
loop (which is another reason you can't put a statement
modifier on it; use C<repeat> for a test-at-the-end loop).
@@ -568,7 +568,7 @@ therefore loop control statements.
=head2 Statement-level bare blocks
Although a bare block occuring as a single statement is no longer
-a do-once loop, it still executes immediately as in Perl 5, as if it
+a do-once loop, it still executes immediately as in Perl 5, as if it
were immediately dereferenced with a C<.()> postfix, so within such a
block C<CONTEXT::> refers to the scope surrounding the block. But unlike
an explicit call, C<CALLER::> doesn't count it as a routine boundary.
@@ -851,12 +851,12 @@ is exactly equivalent to
=head1 Exception handlers
X<CATCH>
-Unlike many other languages, Perl 6 specifies exception handlers by
+Unlike many other languages, Perl 6 specifies exception handlers by
placing a C<CATCH> block I<within> that block that is having its exceptions
handled.
-The Perl 6 equivalent to Perl 5's C<eval {...}> is C<try {...}>.
-(Perl 6's C<eval> function only evaluates strings, not blocks.)
+The Perl 6 equivalent to Perl 5's C<eval {...}> is C<try {...}>.
+(Perl 6's C<eval> function only evaluates strings, not blocks.)
A C<try> block by default has a C<CATCH> block that handles all
exceptions by ignoring them. If you define a C<CATCH> block within
the C<try>, it replaces the default C<CATCH>. It also makes the C<try>
@@ -972,19 +972,19 @@ it first tries this form:
If there is no such lexically scoped outer loop in the current subroutine,
then a fallback search is made outward through the dynamic scopes in
-the same way Perl 5 does. (The difference between Perl 5 and Perl 6
-in this respect arises only because Perl 5 didn't have user-defined
+the same way Perl 5 does. (The difference between Perl 5 and Perl 6
+in this respect arises only because Perl 5 didn't have user-defined
control structures, hence the sub's lexical scope was I<always>
the innermost dynamic scope, so the preference to the lexical scope
-in the current sub was implicit. For Perl 6 we have to make this
+in the current sub was implicit. For Perl 6 we have to make this
preference explicit.) So this fallback is more like the C<context>
form we saw earlier.
-Warnings are produced in Perl 6 by throwing a resumable control
+Warnings are produced in Perl 6 by throwing a resumable control
exception to the outermost scope, which by default prints the
warning and resumes the exception by extracting a resume continuation
from the exception, which must be supplied by the C<warn()> function
-(or equivalent). Exceptions are not resumable in Perl 6 unless
+(or equivalent). Exceptions are not resumable in Perl 6 unless
the exception object does the C<Resumable> role. (Note that fatal
exception types can do the C<Resumable> role even if thrown via
C<fail()>--when uncaught they just hit the outermost fatal handler
@@ -1009,12 +1009,12 @@ function most of the time.
=head1 The goto statement
X<goto>
-In addition to C<next>, C<last>, and C<redo>, Perl 6 also supports
+In addition to C<next>, C<last>, and C<redo>, Perl 6 also supports
C<goto>. As with ordinary loop controls, the label is searched for
first lexically within the current subroutine, then dynamically outside
of it. Unlike with loop controls, however, scanning a scope includes
a scan of any lexical scopes included within the current candidate
-scope. As in Perl 5, it is possible to C<goto> into a lexical scope,
+scope. As in Perl 5, it is possible to C<goto> into a lexical scope,
but only for lexical scopes that require no special initialization
of parameters. (Initialization of ordinary variables does not
count--presumably the presence of a label will prevent code-movement
@@ -1029,8 +1029,8 @@ prohibition on bypassing formal binding.)
=head1 Exceptions
-As in Perl 5, many built-in functions simply return C<undef> when you
-ask for a value out of range, or the function fails somehow. Perl 6
+As in Perl 5, many built-in functions simply return C<undef> when you
+ask for a value out of range, or the function fails somehow. Perl 6
has C<Failure> objects, any of which refers to an unthrown C<Exception>
object in C<$!> and knows whether it has been handled or not. C<$!>
contains one main exception, the most recent, plus an internal list
@@ -1086,7 +1086,7 @@ You can cause built-ins to automatically throw exceptions on failure using
The C<fail> function responds to the caller's C<use fatal> state.
It either returns an unthrown exception, or throws the exception.
-Before you get too happy about this pragma, note that Perl 6 contains
+Before you get too happy about this pragma, note that Perl 6 contains
various parallel processing primitives that will tend to get blown
up prematurely by thrown exceptions. Unthrown exceptions are meant
to provide a failsoft mechanism in which failures can be treated
@@ -1254,7 +1254,7 @@ parentheses aren't necessary around C<EXPR> because the whitespace
between C<EXPR> and the block forces the block to be considered a block
rather than a subscript, provided the block occurs where an infix
operator would be expected. This works for all control structures,
-not just the new ones in Perl 6. A top-level bare block is always
+not just the new ones in Perl 6. A top-level bare block is always
considered a statement block if there's a term and a space before it:
if $foo { ... }
@@ -1403,7 +1403,7 @@ to false in a boolean context.) A list can have a defined length
even if it contains undefined scalar values. A list is of undefined
length only if it contains an undefined generator, which, happily, is
what is returned by the C<fail> function when used in list context.
-So any Perl 6 function can say
+So any Perl 6 function can say
fail "message";
@@ -1413,7 +1413,7 @@ context. To return an explicit scalar undef, you can always say
return undef;
Then in list context, you're returning a list of length 1, which is
-defined (much like in Perl 5). But generally you should be using
+defined (much like in Perl 5). But generally you should be using
C<fail> in such a case to return an exception object.
In any case, returning an unthrown exception is considered failure
from the standpoint of C<let>. Backtracking over a closure in a regex
@@ -1423,7 +1423,7 @@ within a regex closure initiates backtracking of the regex.)
=head1 When is a closure not a closure
-Everything is conceptually a closure in Perl 6, but the optimizer
+Everything is conceptually a closure in Perl 6, but the optimizer
is free to turn unreferenced closures into mere blocks of code.
It is also free to turn referenced closures into mere anonymous
subroutines if the block does not refer to any external lexicals that
View
72 S05-regex.pod
@@ -42,13 +42,13 @@ most recent match is through this variable, even when
it doesn't look like it. The individual capture variables (such as C<$0>,
C<$1>, etc.) are just elements of C<$/>.
-By the way, unlike in Perl 5, the numbered capture variables now
+By the way, unlike in Perl 5, the numbered capture variables now
start at C<$0> instead of C<$1>. See below.
=head1 Unchanged syntactic features
-The following regex features use the same syntax as in Perl 5:
+The following regex features use the same syntax as in Perl 5:
=over
@@ -83,7 +83,7 @@ below on "Longest-token matching".
=head1 Simplified lexical parsing of patterns
-Unlike traditional regular expressions, Perl 6 does not require
+Unlike traditional regular expressions, Perl 6 does not require
you to memorize an arbitrary list of metacharacters. Instead it
classifies characters by a simple rule. All glyphs (graphemes)
whose base characters are either the underscore (C<_>) or have
@@ -96,7 +96,7 @@ but any immediately following alphanumeric character is not).
All other glyphs--including whitespace--are exactly the opposite:
they are always considered metasyntactic (i.e. non-self-matching) and
must be escaped or quoted to make them literal. As is traditional,
-they may be individually escaped with C<\>, but in Perl 6 they may
+they may be individually escaped with C<\>, but in Perl 6 they may
be also quoted as follows.
Sequences of one or more glyphs of either type (i.e. any glyphs at all)
@@ -126,7 +126,7 @@ escaped), non-identifier glyphs are metasyntactic (or literal when
escaped), and single quotes make everything inside them literal.
Note, however, that not all non-identifier glyphs are currently
-meaningful as metasyntax in Perl 6 regexes (e.g. C<\1> C<\_> C<->
+meaningful as metasyntax in Perl 6 regexes (e.g. C<\1> C<\_> C<->
C<!>). It is more accurate to say that all unescaped non-identifier
glyphs are I<potential> metasyntax, and reserved for future use.
If you use such a sequence, a helpful compile-time error is issued
@@ -388,13 +388,13 @@ which language's rules to use for this match.]
=item *
-The new C<:Perl5>/C<:P5> modifier allows Perl 5 regex syntax to be
+The new C<:Perl5>/C<:P5> modifier allows Perl 5 regex syntax to be
used instead. (It does not go so far as to allow you to put your
modifiers at the end.) For instance,
m:P5/(?mi)^(?:[a-z]|\d){1,2}(?=\s)/
-is equivalent to the Perl 6 syntax:
+is equivalent to the Perl 6 syntax:
m/ :i ^^ [ <[a..z]> || \d ] ** 1..2 <?before \s> /
@@ -921,7 +921,7 @@ allow whitespace after the comma but not before, you can say:
=item *
C<< <...> >> are now extensible metasyntax delimiters or I<assertions>
-(i.e. they replace Perl 5's crufty C<(?...)> syntax).
+(i.e. they replace Perl 5's crufty C<(?...)> syntax).
=back
@@ -931,7 +931,7 @@ C<< <...> >> are now extensible metasyntax delimiters or I<assertions>
=item *
-In Perl 6 regexes, variables don't interpolate.
+In Perl 6 regexes, variables don't interpolate.
=item *
@@ -942,11 +942,11 @@ how to handle them (more on that below).
The default way in which the engine handles a string scalar is to match it
as a C<< '...' >> literal (i.e. it does not treat the interpolated string
-as a subpattern). In other words, a Perl 6:
+as a subpattern). In other words, a Perl 6:
/ $var /
-is like a Perl 5:
+is like a Perl 5:
/ \Q$var\E /
@@ -1047,7 +1047,7 @@ you can write:
as long as you're careful to put a space after the initial angle so that
it won't be interpreted as a subrule. With the space it is parsed
-like angle quotes in ordinary Perl 6 and treated as a literal array value.
+like angle quotes in ordinary Perl 6 and treated as a literal array value.
=item *
@@ -1543,7 +1543,7 @@ These tokens are considered declarative, but may force backtracking behavior.
A C<«> or C<<< << >>> token indicates a left word boundary. A C<»> or
C<<< >> >>> token indicates a right word boundary. (As separate tokens,
-these need not be balanced.) Perl 5's C<\b> is replaced by a C<< <?wb> >>
+these need not be balanced.) Perl 5's C<\b> is replaced by a C<< <?wb> >>
"word boundary" assertion, while C<\B> becomes C<< <!wb> >>. (None of
these are dependent on the definition of C<< <.ws> >>, but only on the C<\w>
definition of "word" characters.)
@@ -1763,11 +1763,11 @@ hexadecimal).
=item *
-The Perl 5 C<qr/pattern/> regex constructor is gone.
+The Perl 5 C<qr/pattern/> regex constructor is gone.
=item *
-The Perl 6 equivalents are:
+The Perl 6 equivalents are:
regex { pattern } # always takes {...} as delimiters
rx / pattern / # can take (almost) any chars as delimiters
@@ -1780,7 +1780,7 @@ but only if you interpose whitespace:
rx ( pattern ) # okay
rx( 1,2,3 ) # tries to call rx function
-(This is true for all quotelike constructs in Perl 6.)
+(This is true for all quotelike constructs in Perl 6.)
=item *
@@ -1809,7 +1809,7 @@ longer an interpolating quote-like operator. C<rx> is short for I<regex>,
=item *
As the syntax indicates, it is now more closely analogous to a C<sub {...}>
-constructor. In fact, that analogy runs I<very> deep in Perl 6.
+constructor. In fact, that analogy runs I<very> deep in Perl 6.
=item *
@@ -1900,7 +1900,7 @@ A C<rule> is really short for:
=item *
-The Perl 5 C<?...?> syntax (I<succeed once>) was rarely used and can be
+The Perl 5 C<?...?> syntax (I<succeed once>) was rarely used and can be
now emulated more cleanly with a state variable:
$result = do { state $x ||= m/ pattern /; } # only matches first time
@@ -1932,15 +1932,15 @@ and C<token> declarations, backtracking must be explicit.
To force the preceding atom to do eager backtracking,
append a C<:?> or C<?> to the atom. If the preceding token is
a quantifier, the C<:> may be omitted, so C<*?> works just as
-in Perl 5.
+in Perl 5.
=item *
To force the preceding atom to do greedy backtracking in a
spot that would default otherwise, append a C<:!> to the atom.
If the preceding token is a quantifier, the C<:> may be omitted.
-(Perl 5 has no corresponding construct because backtracking always
-defaults to greedy in Perl 5.)
+(Perl 5 has no corresponding construct because backtracking always
+defaults to greedy in Perl 5.)
=item *
@@ -2206,7 +2206,7 @@ is usually excluded from such patterns, give or take a little
lookahead.) Basically, Perl automatically derives a lexer
from the grammar without you having to write one yourself.
-To that end, every regex in Perl 6 is required to be able to
+To that end, every regex in Perl 6 is required to be able to
distinguish its "pure" patterns from its actions, and return its
list of initial token patterns (transitively including the token
patterns of any subrule called by the "pure" part of that regex, but
@@ -2632,7 +2632,7 @@ pushed onto the array inside the C<Match> object for the entire regex
=item *
-As a result of these semantics, capturing parentheses in Perl 6 are
+As a result of these semantics, capturing parentheses in Perl 6 are
hierarchical, not linear (see L<Nested subpattern captures>).
=back
@@ -2656,7 +2656,7 @@ is the same as:
=item *
-Note that, in Perl 6, the numeric capture variables start from $0, not
+Note that, in Perl 6, the numeric capture variables start from $0, not
$1, with the numbers corresponding to the element's index inside C<$/>.
=item *
@@ -2688,7 +2688,7 @@ object, not to the array of C<$/>.
=item *
-This behavior is quite different from Perl 5 semantics:
+This behavior is quite different from Perl 5 semantics:
# Perl 5...
#
@@ -2700,7 +2700,7 @@ This behavior is quite different from Perl 5 semantics:
=item *
-In Perl 6, nested parens produce properly nested captures:
+In Perl 6, nested parens produce properly nested captures:
# Perl 6...
#
@@ -2859,11 +2859,11 @@ C<|> or C<||> (but not after each C<&> or C<&&>). Hence:
This means that if the second alternation matches, the C<@$/> array will
contain C<('every', 'green', 'BEM', 'devours', 'faces')> rather than
C<(undef, undef, undef, undef, undef, undef, 'every', 'green', 'BEM',
-'devours', 'faces')> (as the same regex would in Perl 5).
+'devours', 'faces')> (as the same regex would in Perl 5).
=item *
-Note that it is still possible to mimic the monotonic Perl 5 capture
+Note that it is still possible to mimic the monotonic Perl 5 capture
indexing semantics. See L<Numbered scalar aliasing> below for details.
@@ -3206,8 +3206,8 @@ Perl5 semantics for consecutive subpattern numbering in alternations:
=item *
-It also provides an easy way in Perl 6 to reinstitute the unnested
-numbering semantics of nested Perl 5 subpatterns:
+It also provides an easy way in Perl 6 to reinstitute the unnested
+numbering semantics of nested Perl 5 subpatterns:
# Perl 5...
# $1
@@ -3710,7 +3710,7 @@ C<line>, etc.
=item *
-Perl 6 will come with at least one grammar predefined:
+Perl 6 will come with at least one grammar predefined:
grammar STD { # Perl's own standard grammar
@@ -3809,7 +3809,7 @@ to the particular declarator in question:
use token :foo; # control token defaults
use rule :foo; # control rule defaults
-(It is a general policy in Perl 6 that any pragma designed to influence
+(It is a general policy in Perl 6 that any pragma designed to influence
the surface behavior of a keyword is identical to the keyword itself, unless
there is good reason to do otherwise. On the other hand, pragmas designed
to influence deep semantics should not be named identically, though of
@@ -3831,7 +3831,7 @@ Use the C<.=> form to do a translation in place:
$str.=trans( %mapping.pairs.sort );
-(Perl 6 does not support the C<y///> form, which was only in C<sed> because
+(Perl 6 does not support the C<y///> form, which was only in C<sed> because
they were running out of single letters.)
=item *
@@ -3928,8 +3928,8 @@ Only non-bracket characters may be used for the "triple quote". The
right side is always evaluated as if it were a double-quoted string
regardless of the quote chosen.
-As with Perl 5, a bracketing form is also supported, but unlike Perl 5,
-Perl 6 uses the brackets I<only> around the pattern. The replacement
+As with Perl 5, a bracketing form is also supported, but unlike Perl 5,
+Perl 6 uses the brackets I<only> around the pattern. The replacement
is then specified as if it were an ordinary item assignment, with ordinary
quoting rules. To pick your own quotes on the right just use one of the C<q>
forms. The substitution above is equivalent to:
@@ -3983,7 +3983,7 @@ the C<< <at($pos)> >> assertion to say that the current position
is the same as the position object you supply. You may set the
current match position via the C<:c> and C<:p> modifiers.
-However, please remember that in Perl 6 string positions are generally
+However, please remember that in Perl 6 string positions are generally
I<not> integers, but objects that point to a particular place in
the string regardless of whether you count by bytes or codepoints or
graphemes. If used with an integer, the C<at> assertion will assume
View
36 S06-routines.pod
@@ -95,8 +95,8 @@ The return type may also be put inside the parentheses:
sub NAME (PARAMS --> RETTYPE) {...}
-Unlike in Perl 5, named subroutines are considered expressions,
-so this is valid Perl 6:
+Unlike in Perl 5, named subroutines are considered expressions,
+so this is valid Perl 6:
my @subs = (sub foo { ... }, sub bar { ... });
@@ -121,7 +121,7 @@ See L<"Properties and traits">.
=head2 Perl5ish subroutine declarations
-You can declare a sub without parameter list, as in Perl 5:
+You can declare a sub without parameter list, as in Perl 5:
sub foo {...}
@@ -135,16 +135,16 @@ This is equivalent to one of:
depending on whether either or both of those variables are used in the body of the routine.
Positional arguments implicitly come in via the C<@_> array, but
-unlike in Perl 5 they are C<readonly> aliases to actual arguments:
+unlike in Perl 5 they are C<readonly> aliases to actual arguments:
sub say { print qq{"@_[]"\n}; } # args appear in @_
sub cap { $_ = uc $_ for @_ } # Error: elements of @_ are read-only
-Also unlike in Perl 5, Perl 6 has true named arguments, which come in
+Also unlike in Perl 5, Perl 6 has true named arguments, which come in
via C<%_> instead of C<@_>. (To construct pseudo-named arguments that
-come in via C<@_> as in Perl 5, the p5-to-p6 translator will use the ugly
-C<< p5=> >> operator instead of Perl 6's C<< => >> Pair constructor.)
+come in via C<@_> as in Perl 5, the p5-to-p6 translator will use the ugly
+C<< p5=> >> operator instead of Perl 6's C<< => >> Pair constructor.)
If you need to modify the elements of C<@_> or C<%_>, declare the
array or hash explicitly with the C<is rw> trait:
@@ -169,7 +169,7 @@ simply fail if the signature cannot be bound.
=head2 Blocks
-Raw blocks are also executable code structures in Perl 6.
+Raw blocks are also executable code structures in Perl 6.
Every block defines an object of type C<Block> (which C<does Callable>), which may either be
executed immediately or passed on as a C<Block> object. How a block is
@@ -234,11 +234,11 @@ To predeclare a subroutine without actually defining it, use a "stub block":
sub foo {...} # Yes, those three dots are part of the actual syntax
-The old Perl 5 form:
+The old Perl 5 form:
sub foo;
-is a compile-time error in Perl 6 (because it would imply that the body of the
+is a compile-time error in Perl 6 (because it would imply that the body of the
subroutine extends from that statement to the end of the file, as C<class> and
C<module> declarations do). The only allowed use of the semicolon form is to
declare a C<MAIN> sub--see L</Declaring a MAIN subroutine> below.
@@ -415,7 +415,7 @@ non-standard syntax available to other scopes.
=head1 Parameters and arguments
-Perl 6 subroutines may be declared with parameter lists.
+Perl 6 subroutines may be declared with parameter lists.
By default, all parameters are readonly aliases to their corresponding
arguments--the parameter is just another name for the original
@@ -459,7 +459,7 @@ Also, C<$ro> may not be returned from an lvalue subroutine or method.
Parameters may be required or optional. They may be passed by position,
or by name. Individual parameters may confer an item or list context
-on their corresponding arguments, but unlike in Perl 5, this is decided
+on their corresponding arguments, but unlike in Perl 5, this is decided
lazily at parameter binding time.
Arguments destined for required positional parameters must come before
@@ -564,7 +564,7 @@ arguments with parentheses or quotes:
push @array, 1, 2, (:a<b>);
push @array, 1, 2, 'a' => 'b';
-Perl 6 allows multiple same-named arguments, and records the relative
+Perl 6 allows multiple same-named arguments, and records the relative
order of arguments with the same name. When there are more than one
argument, the C<@> sigil in the parameter list causes the arguments
to be concatenated:
@@ -1520,7 +1520,7 @@ Also, it is illegal to use placeholder variables in a block that already
has a signature, because the autogenerated signature would conflict with that.
Positional placeholder names consisting of a single uppercase letter are disallowed,
not because we're mean, but because it helps us catch references to
-obsolete Perl 5 variables such as C<$^O>.
+obsolete Perl 5 variables such as C<$^O>.
A function containing placeholders may also refer to either C<@_>
or C<%_> or both, each of which (if so used) will be added to the
@@ -1971,7 +1971,7 @@ new argument list. The caller may also bind the returned C<Capture> directly.
If any function called as part of a return list asks what its context
is, it will be told it was called in list context regardless of the
eventual binding of the returned C<Capture>. (This is quite
-different from Perl 5, where a C<return> statement always propagates its
+different from Perl 5, where a C<return> statement always propagates its
caller's context to its own argument(s).) If that is not the
desired behavior you must coerce the call to an appropriate context,
(or declare the return type of the function to perform such a coercion).
@@ -2557,7 +2557,7 @@ is probably to be construed as Bad Style:
(Note to implementors: this must not be implemented by finding
the final closing delimiter and preprocessing, or we'll violate our
-one-pass parsing rule. Perl 6 parsing rules are parameterized to know
+one-pass parsing rule. Perl 6 parsing rules are parameterized to know
their closing delimiter, so adding the opening delimiter should not
be a hardship. Alternately the opening delimiter can be deduced from
the closing delimiter. Writing a rule that looks for three opening
@@ -2743,7 +2743,7 @@ Proto or multi definitions may not be written in semicolon form,
nor may C<MAIN> subs within a module or class. (A C<MAIN> routine
is allowed in a module or class, but is not usually invoked unless
the file is run directly (see a above). This corresponds to the
-"unless caller" idiom of Perl 5.) In general, you may have only one
+"unless caller" idiom of Perl 5.) In general, you may have only one
semicolon-style declaration that controls the whole file.
If an attempted dispatch to C<MAIN> fails, the C<USAGE> routine is called.
@@ -2794,7 +2794,7 @@ as follows:
:name='spacey value' :name«'spacey value'»
:name=val1,'val 2',etc :name«val1 'val 2' etc»
-Exact Perl 6 forms are okay if quoted from shell processing:
+Exact Perl 6 forms are okay if quoted from shell processing:
':name<value>' :name<value>
':name(42)' :name(42)
View
32 S09-data.pod
@@ -19,15 +19,15 @@ Synopsis 9: Data Structures
=head1 Overview
This synopsis summarizes the non-existent Apocalypse 9, which
-discussed in detail the design of Perl 6 data structures. It was
-primarily a discussion of how the existing features of Perl 6 combine
+discussed in detail the design of Perl 6 data structures. It was
+primarily a discussion of how the existing features of Perl 6 combine
to make it easier for the PDL folks to write numeric Perl.
=head1 Lazy lists
All list contexts are lazy by default. They still flatten eventually,
but only when forced to. You have to use the C<eager> list operator to get a
-non-lazy flattening list context (that is, to flatten immediately like Perl 5).
+non-lazy flattening list context (that is, to flatten immediately like Perl 5).
=head1 Sized types
@@ -292,7 +292,7 @@ higher-level abstraction into some buffer type.)
=head1 Multidimensional arrays
-Perl 6 arrays are not restricted to being one-dimensional (that's simply
+Perl 6 arrays are not restricted to being one-dimensional (that's simply
the default). To declare a multidimensional array, you specify it with a
semicolon-separated list of dimension lengths:
@@ -657,8 +657,8 @@ in the preceding example:
Using a negative index on an array of fixed size will fail if the
resulting number of elements exceeds the defined size.
-Note that the behaviour of negative indices in Perl 6 is
-different to that in Perl 5:
+Note that the behaviour of negative indices in Perl 6 is
+different to that in Perl 5:
# Perl 5...
............_____________________________..................
@@ -675,7 +675,7 @@ different to that in Perl 5:
[-2] [-1] [0] [1] [2] [3] [4] [5] [6] [7]
[*-7] [*-6] [*-5] [*-4] [*-3] [*-2] [*-1] [*+0] [*+1] [*+2]
-The Perl 6 semantics avoids indexing discontinuities (a source of subtle
+The Perl 6 semantics avoids indexing discontinuities (a source of subtle
runtime errors), and provides ordinal access in both directions at both
ends of the array.
@@ -861,12 +861,12 @@ The zero-dimensional slice:
@x[]
is assumed to want everything, not nothing. It's particularly handy
-because Perl 6 (unlike Perl 5) won't interpolate a bare array without brackets:
+because Perl 6 (unlike Perl 5) won't interpolate a bare array without brackets:
@x = (1,2,3);
say "@x = @x[]"; # prints @x = 1 2 3
-Lists are lazy in Perl 6, and the slice lists are no exception.
+Lists are lazy in Perl 6, and the slice lists are no exception.
In particular, things like range objects are not flattened until they
need to be, if ever. So a PDL implementation is free to steal the
values from these ranges and "piddle" around with them:
@@ -877,12 +877,12 @@ values from these ranges and "piddle" around with them:
@nums[1..*:by(2)] # the odds
@nums[0..*:by(2)] # the evens
-That's all just the standard Perl 6 notation for ranges. Additional
+That's all just the standard Perl 6 notation for ranges. Additional
syntactic relief is always available as long as it's predeclared
somehow. It's possible the range operator could be taught that C<:2>
means C<:by(2)>, for instance. (But I rather dislike the RFC-proposed
C<0:10:2> notation that makes colon mean two different things so close
-together, plus it conflicts with Perl 6's general adverb notation if
+together, plus it conflicts with Perl 6's general adverb notation if
the next thing is alphabetic. On top of which, we're using C<:2> as
a general radix notation.)
@@ -905,7 +905,7 @@ That's why we have C<..*> to mean C<..Inf>.
=head1 PDL signatures
-To rewrite a Perl 5 PDL definition like this:
+To rewrite a Perl 5 PDL definition like this:
pp_def(
'inner',
@@ -950,8 +950,8 @@ come back into the signature via C<where> constraints on the types.
This would presumably make multimethod dispatch possible on similarly
typed arrays with differing constraints.
-(The special destruction problems of Perl 5's PDL should go away with
-Perl 6's GC approach, as long as PDL's objects are registered with Parrot
+(The special destruction problems of Perl 5's PDL should go away with
+Perl 6's GC approach, as long as PDL's objects are registered with Parrot
correctly.)
=head1 Junctions
@@ -1231,14 +1231,14 @@ Any mention of an expression within a C<Capture> delays the autovivification
decision to binding time. (Binding to a "ref" parameter also defers the
decision.)
-This is as opposed to Perl 5, where autovivification could happen
+This is as opposed to Perl 5, where autovivification could happen
unintentionally, even when the code looks like a non-destructive test:
# This is Perl 5 code
my %hash;
exists $hash{foo}{bar}; # creates $hash{foo} as an empty hash reference
-In Perl 6 these read-only operations are indeed non-destructive:
+In Perl 6 these read-only operations are indeed non-destructive:
my %hash;
%hash<foo><bar> :exists; # %hash is still empty
View
22 S10-packages.pod
@@ -23,8 +23,8 @@ despite never having been written.
=head1 Packages
-As in Perl 5, packages are the basis of modules and classes. Unlike in
-Perl 5, modules and classes are declared with distinct keywords,
+As in Perl 5, packages are the basis of modules and classes. Unlike in
+Perl 5, modules and classes are declared with distinct keywords,
but they're still just packages with extra behaviors. Likewise every
typename has an associated package namespace, even if unused.
@@ -38,18 +38,18 @@ named subroutine declarations.
As a special exception, if a braceless C<package> declaration occurs
as the first executable statement in a file, then it's taken to mean that the rest of
-the file is Perl 5 code.
+the file is Perl 5 code.
package Foo; # the entire file is Perl 5
...
-This form is illegal in a Perl 6 file. If you wish to have a file-scoped package,
+This form is illegal in a Perl 6 file. If you wish to have a file-scoped package,
either use the brace form or declare it with the C<module> keyword instead.
-Since there are no barewords in Perl 6, package names must be predeclared,
+Since there are no barewords in Perl 6, package names must be predeclared,
or use the sigil-like C<::PackageName> syntax to indicate that the type will
be supplied some other way. The C<::> prefix does not imply globalness as
-it does in Perl 5. (Use C<GLOBAL::> for that.)
+it does in Perl 5. (Use C<GLOBAL::> for that.)
A bare C<package> declarator (without an explicit scope declarator
such as C<my>) declares an C<our> package within the current package
@@ -66,7 +66,7 @@ To declare an anonymous package you can use either of
All files start out being parsed in the C<GLOBAL>
package, but may switch to some other package scope depending on the first
package-ish declaration. If that first declaration is not a package variant, then
-the parsing switches to the "C<main>" package for Perl 5 code. Perl 6 code
+the parsing switches to the "C<main>" package for Perl 5 code. Perl 6 code
stays C<GLOBAL> in that situation. The mainline code is thus in the
C<GLOBAL> namespace unless declared otherwise.
@@ -103,7 +103,7 @@ package up through the containing packages to C<GLOBAL>. If it is not found,
a compiler error results.
As with an initial C<::>, the presence of a C<::> within the name
-does not imply globalness (unlike in Perl 5). True globals are always
+does not imply globalness (unlike in Perl 5). True globals are always
in the C<GLOBAL::> namespace.
The C<PROCESS::> namespace, shared by all interpreters within the process,
@@ -114,7 +114,7 @@ locate C<$PROCESS::PID> if not hidden by an inner context's C<$PID>.)
=head1 Autoloading
A package (or any other similar namespace) can control autoloading.
-However, Perl 5's C<AUTOLOAD> is being superseded by MMD autoloaders
+However, Perl 5's C<AUTOLOAD> is being superseded by MMD autoloaders
that distinguish declaration from definition, but are not restricted
to declaring subs. A run-time declarator multisub is declared as:
@@ -139,7 +139,7 @@ The package itself is just passed as the first argument, since it's
the container object. Subsequent arguments identify the desired type
of the inner container and the "name" or "key" by which the object is
to be looked up in the outer container. Such a name does not include
-its container name, unlike Perl 5's magical C<$AUTOLOAD> variable.
+its container name, unlike Perl 5's magical C<$AUTOLOAD> variable.
Nor does it include the type information of a Code object's "long
name"; this information comes in via the type parameter, and may be
matched against using ordinary subsignature matching:
@@ -147,7 +147,7 @@ matched against using ordinary subsignature matching:
multi CANDO ( MyPackage, &:($), $name, *%args --> Container) # 1 arg
multi CANDO ( MyPackage, &:($,$), $name, *%args --> Container) # 2 args
-The slurpy C<%args> hash is likely to be empty in standard Perl 6
+The slurpy C<%args> hash is likely to be empty in standard Perl 6
usage, but it's possible that some dialects of Perl will desire
a mechanism to pass in additional contextual information, so this
parameter is reserved for such purposes.
View
40 S11-modules.pod