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

Parrot: copying arrays

Thread Next
From:
Alberto Manuel Brandão Simões
Date:
July 12, 2002 00:37
Subject:
Parrot: copying arrays
Message ID:
1026459296.29069.4.camel@scriptorium

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.

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


Thread Next


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