Does anyone have any suggestions about what sort of PIR
code and/or PMCs we need to be able to do make the following 
Perl 6 code work...?

    my @a;
    @a[4] = 'Hello';

    my $b := @a[4];
    say $b;                # says "Hello"

    @a[4] = [1, 2];
    say $b;                # says "1 2" 


Here are the pieces I can fill in:

    #### my @a; 
    new $P0, .Perl6List
    .lex '@a', $P0

    #### @a[4] = 'Hello';
    find_lex $P1, '@a'
    # (in general case we autovivify @a here if needed)
    set $P1[4], 'Hello'

    #### @a[4] = [1, 2]
    $P2 = 'list'(1, 2)     # create a list
    find_lex $P3, '@a'
    # (in general case we autovivify @a here if needed)
    set $P3[4], $P2

But what's a good approach for handling C<$b>, which is bound
to @a[4]?  Do we need a reference type (similar to .Ref) that 
can keep track of a container+key pair?

Pm

Reply via email to