Re: morph()ing

2005-04-27 Thread Leopold Toetsch
Nicholas Clark <[EMAIL PROTECTED]> wrote: > On Tue, Apr 26, 2005 at 08:55:21AM +0200, Leopold Toetsch wrote: >> - morph for scalars is ok: e.g. an Integer transforms itself to a Float >> - morph for arbitrary objects must never be done automatically > So really my morph code ought to check the ne

Re: morph()ing

2005-04-27 Thread Nicholas Clark
On Tue, Apr 26, 2005 at 08:55:21AM +0200, Leopold Toetsch wrote: > - morph for scalars is ok: e.g. an Integer transforms itself to a Float > - morph for arbitrary objects must never be done automatically So really my morph code ought to check the new type to see if it understands it, and if not t

Re: morph()ing

2005-04-26 Thread Leopold Toetsch
Bob Rogers <[EMAIL PROTECTED]> wrote: >From: Leopold Toetsch <[EMAIL PROTECTED]> >But it isn't known, if the last reference to that PMC is reused or not. >If it is the last reference then the finalizer has to run, else not. >As we don't have reference counts, an assign to an object

Re: morph()ing

2005-04-25 Thread Bob Rogers
From: Leopold Toetsch <[EMAIL PROTECTED]> Date: Mon, 25 Apr 2005 17:41:49 +0200 Nicholas Clark <[EMAIL PROTECTED]> wrote: > . . . > Others relate to "this PMC is going away". And as morph involves changing > the internal memory layout of a PMC without it actually going away, only

Re: morph()ing

2005-04-25 Thread Bob Rogers
From: Leopold Toetsch <[EMAIL PROTECTED]> Date: Mon, 25 Apr 2005 08:59:05 +0200 Bob Rogers <[EMAIL PROTECTED]> wrote: >From: Leopold Toetsch <[EMAIL PROTECTED]> >It probably just depends on the implementation of Perl5 references. > Hmm. I'm probably missing something (

Re: morph()ing

2005-04-25 Thread Leopold Toetsch
Nicholas Clark <[EMAIL PROTECTED]> wrote: > On Sun, Apr 24, 2005 at 09:25:43AM +0200, Leopold Toetsch wrote: >> Ok, that can be solved by calling A.destroy() first. But what happens, >> if A has finalizers, which may depend on other finalizers? > Doesn't this mean that there's a split here in "fi

Re: morph()ing

2005-04-25 Thread Nicholas Clark
On Sun, Apr 24, 2005 at 09:25:43AM +0200, Leopold Toetsch wrote: > Nicholas Clark <[EMAIL PROTECTED]> wrote: > > When writing morph methods for PMC classes, am I right in thinking that if > > In effect morph has to be friends of both A and B, because it needs to break > > encapsulation? > > Yep.

Re: morph()ing

2005-04-25 Thread Leopold Toetsch
Bob Rogers <[EMAIL PROTECTED]> wrote: >From: Leopold Toetsch <[EMAIL PROTECTED]> >It probably just depends on the implementation of Perl5 references. > Hmm. I'm probably missing something (it wouldn't be a first), but if > the reference points to $a itself rather than the PMC to which $a

Re: morph()ing

2005-04-24 Thread Bob Rogers
From: Leopold Toetsch <[EMAIL PROTECTED]> Date: Sun, 24 Apr 2005 09:25:43 +0200 Nicholas Clark <[EMAIL PROTECTED]> wrote: > In effect morph has to be friends of both A and B, because it needs to break > encapsulation? Yep. The same is true for C, which additionally to C, get

Re: morph()ing

2005-04-24 Thread Leopold Toetsch
Nicholas Clark <[EMAIL PROTECTED]> wrote: > When writing morph methods for PMC classes, am I right in thinking that if > morphing from class A to class B, where both use the PMC_struct_val to > store structures of different types, it's totally up to the morph method > to know how to correctly dispo

morph()ing

2005-04-23 Thread Nicholas Clark
When writing morph methods for PMC classes, am I right in thinking that if morphing from class A to class B, where both use the PMC_struct_val to store structures of different types, it's totally up to the morph method to know how to correctly dispose of the old class A structure, and create and in