On Tue, Jul 08, 2003 at 05:52:04PM -0700, Austin Hastings wrote:
> 
> --- Jonadab the Unsightly One <[EMAIL PROTECTED]> wrote:
> > Am I now thinking clearly?
> > 
> I don't think so.
> 
> If you've created two separate arrays that happen to start with related
> values, then the changes to the first won't affect the second.
> 
> If splice overwrites the values instead of dropping and then replacing
> them, it's going to produce some strange behavior.

What kind of strange behavior?  Can you give an example?


> I think that for example:
> 
>     my @a is Array of int;
>     my $r_slice is Array of int;
> 
>     # ... as before ...
> 
> should behave as expected, and "expected" in this case means
> copy-on-assign. 


Could you elaborate on this?  



>OTOH, if you said C<$r_slice := @a ...> then you'd be
> binding, not copying, and the one-change-affects-both behavior is in
> effect.
> 
> =Austin
 
You also wouldn't be using a slice, you'd be using a reference to the
array.  Or was the ellipsis supposed to indicate the slice indices?


--Dks

Reply via email to