develooper Front page | perl.perl5.porters | Postings from March 2012

[perl #24250] "return" required in some anonymous closures

From:
Father Chrysostomos via RT
Date:
March 30, 2012 22:15
Subject:
[perl #24250] "return" required in some anonymous closures
Message ID:
rt-3.6.HEAD-4610-1333170902-110.24250-15-0@perl.org
On Fri Mar 30 18:15:13 2012, jkeenan wrote:
> On Tue Oct 21 14:04:34 2003, davem wrote:
> > On Tue, Oct 21, 2003 at 01:46:27PM -0700, Yitzchak Scott-Thoennes
> > wrote:
> > > On Tue, Oct 21, 2003 at 09:34:24PM +0100, Dave Mitchell
> > <davem@fdgroup.com> wrote:
> > > > In the medium-term, I want to remove the sub(){$x} feature from
> > Perl,
> > > > and also make constant.pm do it another way. Both are relatively
> > easy to
> > > > do (although in the longer term there may be even cleverer ways of
> > doing
> > > > it in constant.pm that would be harder to do but more efficient).
> > > > However, in the short term (ie for 5.8.2), neither of these
> > changes should
> > > > happen (I'm not even sure if they should happen in any 5.8.x
> > release).
> > >
> > > Given that we have a report of the feature breaking code as of
> > 5.8.0,
> > > it would be advisable to fix it in the end-of-yearish 5.8.x release.
> > 
> > Perhaps, but its been broken for 1.5 years befor anyone noticed.
> > During
> > that time people may have added code that indadvertently uses the new
> > behaviour and so would break if reverted.
> > 
> > >
> > > > So the only real question for 5.8.2 is whether we want to add a
> > > > deprecation warning for the feature we added (undocumented) in
> > 5.8.0
> > > > and which we intend to remove in 5.10.0 (conscensus permitting).
> > >
> > > The point of a warning seems more to me to be for when the coder
> > didn't
> > > want a constant that for when he/she did.
> > 
> > i *think* that's what I was saying. Every time Perl does the strange
> > 5.8.0-ish convertion to a constant, you would get the warning. Normal
> > closures would be silent.
> > 
> 
> Discussion in this ticket petered out nine years ago.
> 
> Are there any code or documentation changes we should be considering
> with respect to the issues raised?
> 
> If not, can we close the ticket?

This is still a bug that needs fixing.  See also
<https://rt.perl.org/rt3/Ticket/Display.html?id=94490#txn-919044>.

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=24250



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About