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

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

From:
Zefram
Date:
April 20, 2012 04:44
Subject:
Re: [perl #24250] "return" required in some anonymous closures
Message ID:
20120420114350.GL4237@lake.fysh.org
Nicholas Clark wrote:
>So, do we want to remove the inlining of (inferred to be)-constant value
>closures?

Inlining of *actual* constant-value subs should remain, but "sub () {
$x }" should not be perceived as constant-value.  We should replace
that mechanism by an explicit generator for constant-value subs of
runtime-specified value (trivially implemented in XS).

I've been wondering where the inlining really ought to be implemented.
With the call-checker mechanism, maybe the inlining of constant-value
subs should be exposed as a non-standard call checker, rather than
marring the standard code with an awkward special case.

-zefram



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