develooper Front page | perl.perl5.porters | Postings from May 2006

Re: [perl #3306] DESTROY doesn't get called.

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
May 1, 2006 10:49
Subject:
Re: [perl #3306] DESTROY doesn't get called.
Message ID:
20060501174941.GD2758@iabyn.com
On Mon, May 01, 2006 at 08:21:24PM +0300, Yuval Kogman wrote:
> > bless currently just updates the pointed-top CV.
> 
> Hence copy on right

If bless just does a copy-on-write, then this breaks:

$ perl588 -we '$a = sub {}; $b = $a; bless $a; print "not ok\n" if $a != $b'

> This is what i propose:
> 
> 	compiling of a sub will create a sub prototype, with no exposed
> 	perl space value
> 
> 	CVs become a small node, with typical SVish things, like a
> 	blessed class, ref count, etc, and for closures they can also
> 	refer to captured variables, I guess

but that's roughly what a CV is anyway: it's an SV that contains pointers
to an op tree and a scratchpad.



-- 
You're only as old as you look

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About