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
July 17, 2009 16:16
Re: Hooks at the end of a scope during compile time
Message ID:
On Fri, Jul 17, 2009 at 03:39:02PM -0500, David Nicol wrote:
> On Fri, Jul 17, 2009 at 3:04 PM, Ben Morrow <> 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.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About