At 11:10 AM 12/14/2001 +0000, Simon Cozens wrote:
>On Fri, Dec 14, 2001 at 12:06:51AM -0800, Brent Dax wrote:
> > Also, a question if/once it exists.  I assume it'll make a copy.
>
>Yep. Although I'm not quite sure off-hand how to write it.

Well, that depends. It could either make a copy, in which case it should 
call the target's assignment vtable entry, or it should just copy the 
pointer over, in which case it shouldn't do anything besides copying the 
pointer from one register to another.

I'm thinking it should just be a pointer copy, and real assignment should 
have its own op. I'm open to debate on that, though.

> > If that's the case, then in this bit of code:
> >
> >       new P0, PerlInt
> >       new P1, PerlString
> >       set P1, P0
> >
> > is P1 a PerlString or a PerlInt?  I think PerlString, because otherwise
> > there'd be no way to cast between types.
>
>Precisely.

Nope. P1 will either point to the same PMC that P0 does, or you'll have 
called the assignment entry of P1's vtable, in which case it could do 
whatever it thinks is appropriate. (For normal perl scalars it'll be to 
morph itself to a PerlInt)

                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to