Brent 'Dax' Royal-Gordon writes:
> Alexey Trofimenko <[EMAIL PROTECTED]> wrote:
> > my $var = "test";
> > my @arr := $var;
> > error? or maybe it would be the same weirdness, like in former example? or
> > maybe it's a ["test"]?
>
> The := operator uses the same rules as parameter passing. So, what do
> you think this does?
>
> sub foo(@arr) {...}
> foo($var);
>
> I would assume the answer is "syntax error". (Remember, array
> parameters don't slurp in Perl 6 unless they have a *.)
Not really "syntax error", but runtime error. The function is expecting
an array, and it gets a string.
This is perfectly legal:
sub foo(@arr) {...}
my $var = [1,2,3];
foo($var);
And it works just as if there were an @ on the front of var.
Luke
>
> --
> Brent 'Dax' Royal-Gordon <[EMAIL PROTECTED]>
> Perl and Parrot hacker
>
> "For those of you that can't spell, this site also contains free
> imags, iamges, imges, picturs, pcitures, picktures, picturess, and
> pistures."
>