On Sun, Dec 16, 2001 at 11:56:46PM -0500, Jeff G wrote:

> so it generates code that has commands like 'set P0, P1', so that
> instruction needs to be added. The consensus on that thread seems to be
> that it should perform a deep copy of the PMC, at least to the pointer
> level. I'll hopefully be committing this tonight.

Can you clarify what you mean by "deep copy" at least to the pointer level ? 

set P0, P1
 
should invoke P0's "assignment" vtable function (does anyone know if it already
exists under a different name ?). For the existing PMC's the appropriate
assignment vtable calls P1's clone function with P0 as the destination.

Clone for Perlundef, Perlnum, and Perlint, are basically memcopy. Clone for
PerlString needs to make a copy of the underlying STRING.

PMCs that implement tied or strictly typed variables can provide more complex
assignment functions.

This allows tie'ing and type checking to take place within P0. For example,
PMCs that will only accept integer values can do get_integer/set_integer
instead of using clone.

-- 
Jason

Reply via email to