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

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

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
May 1, 2006 12:45
Subject:
Re: [perl #3306] DESTROY doesn't get called.
Message ID:
20060501194508.GM45236@plum.flirble.org
On Mon, May 01, 2006 at 06:49:41PM +0100, Dave Mitchell wrote:
> 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'

So the problem is that there are two pairs of two in:

$ perl -lwe 'sub foo { my $q = sub {}; ($q, $q) } my @a = foo(); my @b = foo; print "@a / @b"'
CODE(0xfdd84) CODE(0xfdd84) / CODE(0xfdd84) CODE(0xfdd84)

but currently it's not clear which they are :-)

I like the idea of the real copies but shared scratchpads. I hope it's viable.

Nicholas Clark

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