develooper Front page | perl.perl5.porters | Postings from August 2003

Re: [perl #10030] DESTROY not called on code reference objects

Thread Previous | Thread Next
From:
Arthur Bergman
Date:
August 20, 2003 02:53
Subject:
Re: [perl #10030] DESTROY not called on code reference objects
Message ID:
01851A72-D2F4-11D7-9F75-000A95A2734C@nanisky.com

On Wednesday, August 20, 2003, at 04:31  am, Kurt Starsinic wrote:

> So it seems to me that, in Perl, a named subroutine is never a
> closure, and an anonymous subroutine is always a closure.  The fact
> that perl optimizes the special case of an anonymous subroutine with 0
> private bindings is an implementation detail of interest to a tiny few.
> This behavior is not guaranteed, and based on Simon's bug, I suspect
> that it will change.

I would say an anonymous subroutine is just that, an anonymous 
subroutine. It needs outside lexicals to be a closure.

However, I also think this issue is totally irrelevant since only a 
select few are evil enough to do anything about it, and it is trivial 
to have a wrapper object around it. Slowing down all anonymous 
subroutines is just silly. Just document it, close the bug and get on 
with life.

Arthur


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