Front page | perl.perl6.language |
Postings from May 2007
Purging [-1]
From:
Jonathan Lang
Date:
May 25, 2007 17:54
Subject:
Purging [-1]
Message ID:
ef30550b0705251754u7664758dubc5d64a1ec4902d7@mail.gmail.com
I just went through all of the synopses searching for instances where
[-1] is still being referenced in its perl5 sense; the following
patches update them to correct perl6 syntax. I also took the liberty
of fixing up a markup glitch in S03.pod.
=begin S02
@@ -1379,7 +1379,7 @@
=item *
-The C<$#foo> notation is dead. Use C<@foo.end> or C<@foo[-1]> instead.
+The C<$#foo> notation is dead. Use C<@foo.end> or C<@foo[*-1]> instead.
(Or C<@foo.shape[$dimension]> for multidimensional arrays.)
=back
=end S02
=begin S03
--- S03.pod 2007-05-25 17:32:16.000000000 -0700
+++ S03a.pod 2007-05-25 17:38:14.000000000 -0700
@@ -1606,7 +1606,7 @@
=item *
-C<qw{ ... }> gets a synonym: C< < ... > >, and an interpolating
+C<qw{ ... }> gets a synonym: C<< < ... > >>, and an interpolating
variant, C<«...»>.
For those still living without the blessings of Unicode, that can also be
written: C<<< << ... >> >>>.
@@ -1614,7 +1614,7 @@
=item *
In item context comma C<,> now constructs a C<List> object from its
-operands. You have to use a C<[-1]> subscript to get the last one.
+operands. You have to use a C<[*-1]> subscript to get the last one.
=item *
@@ -2146,7 +2146,7 @@
is short for something like:
- @array[0..^@array], @array[-1] xx *
+ @array[0..^@array], @array[*-1] xx *
An empty Range cannot be iterated; it returns a C<Failure> instead. An empty
range still has a defined min and max, but the min is greater than the max.
@@ -3050,8 +3050,8 @@
are equivalent to
- $x = @y[0] = @y[1] = @y[2] ... @y[-1] = $z = 0
- $x += @y[0] += @y[1] += @y[2] ... @y[-1] += $z += 1
+ $x = @y[0] = @y[1] = @y[2] ... @y[*-1] = $z = 0
+ $x += @y[0] += @y[1] += @y[2] ... @y[*-1] += $z += 1
rather than
=end S03
--
Jonathan "Dataweaver" Lang
-
Purging [-1]
by Jonathan Lang