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

[perl #113930] Lexical subs

Thread Next
From:
Father Chrysostomos via RT
Date:
September 11, 2012 14:12
Subject:
[perl #113930] Lexical subs
Message ID:
rt-3.6.HEAD-11172-1347397920-796.113930-14-0@perl.org
On Tue Sep 11 06:00:47 2012, perl.p5p@rjbs.manxome.org wrote:
> * Father Chrysostomos via RT <perlbug-comment@perl.org> [2012-09-
> 10T21:06:27]
> > Like this?
> >
> > package experimental;
> > ...
> 
> Roughly.  Someone else brought up the forward compatibility. I talked
> about
> this however-long-ago when talking about feature.pm's future, and
> suggested
> something like this (munged to be specific to this case):
> 
>   lexical sub declarations are allowed if feature
> experimental::lexical_subs
>   is on
> 
>   use experimental 'lexical_subs' == use feature
> 'experimental::lexical_subs'
> 
>   when lexical_subs is non-experimental, it goes behind feature
> lexical_subs
> 
>   ...and experimental::lexical_subs is an alias to that
> 
> This lets you write code using experimental::lexical_subs in 5.18 and
> have it
> keep working without editing in 5.20, the way we'd expect from an
> experimental
> feature today.  If the experimental feature is killed, though, your
> code will
> have had to had that "use experimental" somewhere in it (or maybe "use
> feature
> 'experimental::...".)

OK, if you look at the sprout/lexsub branch *now*, you will find that
variation--and documentation, too!

> > my(undef)=(undef) # return a true value
> 
> Now you're just baiting me!

Programming in Perl is supposed to be fun, no?

(I think your idea is better, but I never got to putting forth my idea
about an experimental warnings category.  It would be on by default,
like deprecations [bugs aside, mumble mumble], but ‘no warnings
"experimental"’ would turn off the constant nagging.)

-- 

Father Chrysostomos


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