-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 8/13/10 22:03 , Aaron Sherman wrote: > On Fri, Aug 13, 2010 at 8:11 PM, Jon Murray <perlsm...@gmail.com> wrote: > >> 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 >> >> > > Nope. In fact, as you indicated in the comment you left in, that prints 0 > just like the first example. In neither case is $a modified. In Perl 5, on > the other hand, the passed value can be modified: > > $ ./perl6 -e 'sub foo { @_[0] = 1 } ; my $a = 0; foo($a); say $a' > 0 > $ perl -le 'sub foo { $_[0] = 1 } my $a = 0; foo($a); print $a' > 1 > > You might well be correct about how it's supposed to work, but that's > certainly not the current behavior.
As I read the spec, "is ref" should work (with some caveats). I have no idea if Rakudo currently implements it. - -- brandon s. allbery [linux,solaris,freebsd,perl] allb...@kf8nh.com system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.10 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkxl+sYACgkQIn7hlCsL25Vh2wCeNZuQy7zhWqxYM/I87DBaSkDr FzkAoIdwWGAR6r3y498xLUr2TBNduy9H =FkBh -----END PGP SIGNATURE-----