My understanding from synopses was that you get the Perl 5 behaviour if
you omit the signature on your function declaration (though I
unfortunately can't check as I don't have Rakudo installed):

sub foo { @_[0] = 1 }
my $a = 0;
foo($a);
say $a; # 0

Cheers...

On Fri, 2010-08-13 at 12:06 -0400, Aaron Sherman wrote:
> On Fri, Aug 13, 2010 at 11:27 AM, Jonathan Worthington
> <jonat...@jnthn.net>wrote:
> 
> >
> >>
> > I saw a video camera in the room, but not sure when we'll be seeing the
> > footage from that. In the meantime, the slides are at:
> >
> > http://www.jnthn.net/papers/2010-yapc-eu-signatures.pdf
> >
> >
> Nice talk! One minor nit, and perhaps I'm just misunderstanding some subtle
> use of the terminology, but you say:
> 
> "In Perl 5, you get a copy of the arguments to work with in @_."
> 
> However, this isn't true (again, unless I'm misunderstanding you). @_ is a
> by-reference list of positional parameters (Perl 5 only has positionals)
> which are all read-write, which it's interesting to note, is impossible in
> Perl 6... well, at least in Rakudo, as I'm not sure what the behavior is
> supposed to be, but a slurpy positional list in Rakudo that's declared "is
> rw" does not change the values passed in:
> 
> sub foo(*...@_ is rw) { @_[0] = 1 }
> my $a = 0;
> foo($a);
> say $a; # 0
> 
> Kind of interesting that you can't easily emulate Perl 5's parameter
> passing...
> 


Reply via email to