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

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

From:
Yitzchak Scott-Thoennes
Date:
October 21, 2003 13:47
Subject:
Re: [perl #24250] "return" required in some anonymous closures
Message ID:
20031021204627.GA3860@efn.org
On Tue, Oct 21, 2003 at 09:34:24PM +0100, Dave Mitchell <davem@fdgroup.com> wrote:
> On Tue, Oct 21, 2003 at 10:14:48PM +0200, Elizabeth Mattijsen wrote:
> > At 12:54 -0700 10/21/03, Yitzchak Scott-Thoennes wrote:
> > > > If any cleverer ways are devised of handling large numbers of imported
> > >> constants, a la POSIX, then Export.pm and/or constant.pm can be hacked
> > > > to accomodate them.
> > >That doesn't sound like something to do for 5.8.2 if released in a few
> > >weeks.  How doable would it be to give a warning for "const" padsv
> > >anon subs, and just have constant.pm turn off the warning?
> > 
> > The way I understand it now, is that the check for making this 
> > special case is somehow wrong.  How difficult would it be to add a 
> > check there that it would do the optimization if the current package 
> > is "constant.pm" ?  And just not do the optimization otherwise?
> > 
> > Just as a stopgap for now...
> 
> 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.

> 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.



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