At 02:50 AM 2/19/2001 +0000, Simon Cozens wrote:
>On Sun, Feb 18, 2001 at 09:34:46PM -0500, Dan Sugalski wrote:
> > At 01:13 AM 2/19/2001 +0000, Alan Burlison wrote:
> > >Dan Sugalski wrote:
> > >
> > > > Grab one via a utility function. getPMC() or something of the sort.
> > >
> > >newPMC() ? ;-)
> >
> > Works for me.
>
>Slight that-sucks alert: So, if I have to get a new PMC of class X (which is
>something that's going to have to happen often) I call
> X->vtbl->new(newPMC())
>or
> X->vtbl->morph(newPMC(),X);
X->vtbl->new. (Whether you snag a new PMC with newPMC or get handed a
scratch one by the interpreter depends on circumstance) Morph is used for
active variables, while new can assume that the PMC it was handed is dead.
I was originally thinking that new should handle the case where the PMC it
was handed might need cleanup, but at this point I think that's a bad
thing--it forces important code out too many places, and if we want at
least semi-determinate cleanup we ought be doing it someplace else anyway.
Dan
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
[EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk