Leopold Toetsch writes:
> Luke Palmer <[EMAIL PROTECTED]> wrote:
> > Here's that op that replaces the header of one PMC with another's, if
> > people are interested.
> 
> > +inline op supplant(in PMC, in PMC) {
> > +    *$1 = *$2;
> 
> Brrr. I'm not willing to contemplate now on the nasty side effects
> that might have,

Yeah, I was wondering if there were any problems with double destruction
or anything.  Maybe it can be made to work if $2 is destroyed when the
operation is performed.  I think this could indeed be a useful op if we
can verify there are no side effects, or make it such that there
aren't...

> but what for are you using that?

For doing precisely the assign thing for PMCs that don't have assign in
their vtable.  That and allowing a level of hacking about in my language
otherwise unavailable.

This was awhile ago.  Perhaps there's another solution looming, for
instance that PerlArray trick you showed earlier.  I think a Ref would
work, but Ref delegates set_pmc to what it's referencing, so it's never
possible to change the referent!  Is it?

Luke

> leo

Reply via email to