develooper Front page | perl.perl6.language | Postings from September 2006

Re: [svn:perl6-synopsis] r11965 - doc/trunk/design/syn

Thread Previous | Thread Next
From:
Larry Wall
Date:
September 12, 2006 10:16
Subject:
Re: [svn:perl6-synopsis] r11965 - doc/trunk/design/syn
Message ID:
20060912164853.GA28384@wall.org
On Tue, Sep 12, 2006 at 06:16:26PM +0200, Dr.Ruud wrote:
: larry schreef:
: 
: > +Likewise, from the fact that list context flattens inner arrays and
: > +lists, it follows that a reduced assignment does no special syntactic
: > +dwimmery, and hence only scalar assigments are supported.  Therefore
: > +
: > +    [=] $x, @y, $z, 0
: > +    [+=] $x, @y, $z, 1
: > +
: > +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
: 
: I assume that
: 
:   [=] $x, @y
: 
: is equivalent to
: 
:   $x = @y[0] = @y[1] = @y[2] ... @y[-2] = y[-1]
: 
: then.

Yes.

: Or is a scalar required at the end?

Yes, but @y[-1] is a perfectly fine scalar.

Larry

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About