Taking a thread from Perl 6 Internals. Will Perl 6 support this behavior?

        $ perl <<'EOT'
                my @ary;
                my $ref = \$ary[0];
                $$ref = "value";
                print '$ary[0] : ', $ary[0], "\n";
        EOT
        $ary[0] : value

Presumably the Perl 6 would be:

        my @ary;
        my $ref = [EMAIL PROTECTED];
        $$ref = "value";
        print '@ary[0] : ', @ary[0], "\n";   # -> @ary[0] : value

If that's supported, then how will this behave?

        my @cows of Cow;
        my $slot = [EMAIL PROTECTED];
        $$slot = new Dog;

Do we wind up with Clarus or an exception? (Never mind whether you take exception with Clarus.) Hopefully an exception, from a user's POV. And this?

        my @cows of Cow:
        my @cats of Cat;
        my $ref = [EMAIL PROTECTED];
        @cats[0] := $$ref;
        @cats[1] := @cows[0];   # Just to hammer the point home....
        $$ref = new Dog;

But then there's a question for p6i as to how all the above happens.



Gordon Henriksen
[EMAIL PROTECTED]



Reply via email to