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:
David Nicol
Date:
July 17, 2009 13:39
Subject:
Re: Hooks at the end of a scope during compile time
Message ID:
934f64a20907171339n1d363943yae5ee5c2f5ce1772@mail.gmail.com
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)


One further issue here that nothing currently addresses is that things
> that are supposed to have lexical scope shouldn't leak out into do FILE/
> require/use and should leak out into eval STRING.


"Lexical" may be the wrong word then.  "Local" semantics are closer, for
when you want to set something that might not "leak out" but is /visible/
from do-file.

(several paragraphs thinking out loud about trying to change C<local> to use
aliasing instead of assignment removed)

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