develooper Front page | perl.perl5.porters | Postings from December 2017

Re: We need a language design process.

Thread Previous | Thread Next
Tomasz Konojacki
December 30, 2017 23:09
Re: We need a language design process.
Message ID:

On Sat, 30 Dec 2017 23:43:36 +0100 (Ævar Arnfjörð Bjarmason) wrote:

> I'm not ignoring that, but I think my point still stands.
> If we're going to play language police with perlpolicy.pod there's no
> *explicit* mention of something that was previously a non-experimental
> feature becoming experimental, so by that definition we can never change
> given/when.
> However, immediately after defining what "experimental" means it talks
> about how "deprecated" features may be removed in just two release
> cycles.
> That's talking about removing a feature of perl that's never been
> experimental, and has been there since 1987.

You're right although there's a one problem. We almost never remove
widely used features.

I can think of two notable exceptions, defined(@foo) and . in @INC.
However, there's a one, extremely important difference between those
features and smartmach/given/when: they were easily replaceable.

All you had to do to fix code using defined(@foo) was remove defined().

All you had to do to fix code relying on '.' in @INC was add "use lib '.'"
at the beginning of the script.

With new smartmatch the situation is completely different. How would you
fix $foo ~~ $bar? is it $foo ~~ any(stringwise($bar))? or maybe $bar is
a regexp? Maybe it can be both?

And that's our real problem. Old smartmatch and given/when have no real
replacement. That's why we have to rethink everything from the beginning.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About