develooper Front page | perl.perl6.internals | Postings from July 2002

Re: Parrot: copying arrays

Thread Previous
From:
Alberto Manuel Brandão Simões
Date:
July 12, 2002 01:10
Subject:
Re: Parrot: copying arrays
Message ID:
1026461242.29069.13.camel@scriptorium
On Fri, 2002-07-12 at 08:34, Alberto Manuel Brandão Simões wrote:
> 
> Hi.
> 
> Using PerlArray PMC, if I use
> 
> 	new P0, .PerlArray
> 	set P1, P0
> 
> P1 becomes a 'pointer' to the same array as P0. Now the question is, and
> if I want a new copy? If all PerlArray elements are
> integer/number/string I think that should be easy to do a loop to copy
> all values. The question is that when we have any PMC inside the array,
> I will need a way to copy it.
> 
> And, BTW, this method for copying it should be independent from it's
> contents (meaning we should not need if needing to use I, N, S or P
> registers.
> 

If I just could do

	set P1[I1], P0[I0]

Alberto

> Thanks for the help :)
> Alberto Simões
> -- 
> Alberto Manuel B. Simoes
> Departamento de Informática - Universidade do Minho
> http://alfarrabio.di.uminho.pt/~albie - http://numexp.sf.net
> 
-- 
Alberto Manuel B. Simoes
Departamento de Informática - Universidade do Minho
http://alfarrabio.di.uminho.pt/~albie - http://numexp.sf.net


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About