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

Parrot: copying arrays

Thread Next
Alberto Manuel Brandão Simões
July 12, 2002 00:37
Parrot: copying arrays
Message ID:


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

Thanks for the help :)
Alberto Simões
Alberto Manuel B. Simoes
Departamento de Informática - Universidade do Minho -

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About