On Wed, Mar 16, 2005 at 01:48:27PM -0600, Rod Adams wrote:
: Larry Wall wrote:
: >Yes, and it distributes as any array return type declaration would.
: >
: >
: Does this mean that we can define multiple slurpuy arrays (and
: hashes?!?) in a parameter list, of different types, and Perl will sort
: the arguments into the right slurpy for us? If so, how does this
: interact with the answer about C<@CALLER::_>?
No, I just meant that
Foo [EMAIL PROTECTED]
applies the Foo as the type of the elements of @array despite the
presence of the *.
: I'm not counting on it being ordered. I'm testing to see if any of the
: lists still has anything left in it. The left to right-ness of the
: processing is done in the C<for>.
Oh, right--I'd better learn to read Perl 6 one of these days. :-)
: My thought was that people might want to update the values stored
: inside, as an homage to my common Perl 5 construct:
:
: for ($var1, $var2) {
: s/.../.../;
: s/.../.../;
: }
:
:
: (and yes, I'm a bit chagrined that Perl6 is converting that lovely thing to:
:
: for $var1, $var2 -> $_ is rw {
: s/.../.../;
: s/.../.../;
: }
:
: though
:
: given $var1 {
: s/.../.../;
: s/.../.../;
: }
:
: is nice.
:
: )
Well paint yourself unchagrined, because S04 sez:
Parameters are by default constant within the block. You can
declare a parameter read/write by including the "is rw" trait. If
you rely on $_ as the implicit parameter to a block, then then $_
is considered read/write by default. That is, the construct:
for @foo {...}
is actually short for:
for @foo -> $_ is rw {...}
so you can modify the current list element in that case. However,
any time you specify the arguments, they default to read only.
Larry