develooper Front page | perl.perl5.porters | Postings from July 2009

Re: Hooks at the end of a scope during compile time

Thread Previous | Thread Next
From:
Abigail
Date:
July 17, 2009 16:16
Subject:
Re: Hooks at the end of a scope during compile time
Message ID:
20090717231617.GH21723@almanda
On Fri, Jul 17, 2009 at 03:39:02PM -0500, David Nicol wrote:
> On Fri, Jul 17, 2009 at 3:04 PM, Ben Morrow <ben@morrow.me.uk> wrote:
> 
> In the end, I find the idea of having to create an object with a DESTROY
> > method when all you want to do is run some code at the appropriate time
> > rather messy.
> 
> 
> Me too.  And supporting the "DESTROY as scope-end hack" also wrecks the
> possibility of switching garbage collection paradigms. (how much mindshare
> did the proposed "volatile" attribute get? Probably not a lot, since in the
> absence of alternate GC methods everything is volatile anyway, rendering
> C<:volatile> a no-op)


I remember Dan Sugalski once pointing out that you can decouple the
garbage collection time from the out of scope effects. 

I think there's too much perl5 code that depends on DESTROY being run
when the object goes out of scope to be able to change this. I for
one have written, and will continue to write, lots of code that depends
on this.



Abigail

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