On Sat, Aug 27, 2005 at 14:29:29 +0200, Ingo Blechschmidt wrote:
> Ingo Blechschmidt wrote:
> * @array[$out_of_bounds_index] := $var;
>   # Fatal error ("Can't rebind non-existant container")?
>   # Or autovivify @array[$out_of_bounds_index]?

IMHO definately autovivify

> 
> * @foo[$idx] := $var;
>   my @bar     = @foo;
>   $var        = $new_var;
>   # @foo[$idx] and $var are now $new_var, but @bar is unchanged, right?

Yes, I agree. But we do need a way in the middle. Right now we have:

        @bar := @foo; # array container aliased, so all nested
        containers are shared

        @bar = @foo; # array structure duplicated, elem containers
        duplicated

but no way to say all the elements are the same, but the structure
isn't. Maybe this works, but I don't think so since assignment isn't
an operator, but a syntactic construct (i think):

        @bar >>:=<< @foo;

But anyway, were you to do that you could say:

        pop @bar; @foo's last elem still exist
        $bar[0]; # @foo's first elem *is* changed

-- 
 ()  Yuval Kogman <[EMAIL PROTECTED]> 0xEBD27418  perl hacker &
 /\  kung foo master: /me dodges cabbages like macalypse log N: neeyah!

Attachment: pgpBXJfdQNDE2.pgp
Description: PGP signature

Reply via email to