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

Re: Perl 5.16 and Beyond.

Thread Previous | Thread Next
From:
Chris Prather
Date:
September 13, 2011 10:47
Subject:
Re: Perl 5.16 and Beyond.
Message ID:
CAEP+=B3mjZsDYBEgsgV3hSZU1CmpZzdOjkqrVD+hH1ZH_zbPMQ@mail.gmail.com
On Tue, Sep 13, 2011 at 9:21 AM, Abigail <abigail@abigail.be> wrote:
> On Tue, Sep 13, 2011 at 09:04:12AM -0400, David Golden wrote:
>> On Tue, Sep 13, 2011 at 7:48 AM, Abigail <abigail@abigail.be> wrote:
>> > In Jesse's scheme, from 5.16 onwards, this is going to mean "5.14
>> > semantics".  But if this is run on 5.20, it shouldn't restrict itself
>> > to patterns with 5.14 semantics. If it's run on 5.20, it should also
>> > work on regexp constructs that were introduced in 5.18.
>>
>> I'm very glad that Jesse put forth this ambitious vision, and at the
>> same time, I worry that the devil is in the details and that we might
>> find it hard to set expectations.  Here's another simple example
>> inspired by yours:
>
>
> Here's an even simpler example:
>
>
>    use 5.18;
>    sub mylc {
>        lc $_ [0];
>    }
>
>
> Normally, I would document that as "mylc returns the lowercase of its
> argument".
>
> But that should now be documented as "mylc returns the 5.18 lowercase
> version of its argument". After all, lc may change semantics in the
> future. (Of course, I'm just using 'lc' as an example here; it could
> be any other expression). And that would require people to not only
> know the semantics of the version of Perl they are using - but also the
> semantics of all versions since 5.14 up to the one they are working with.

You don't actually escape this problem now. Having worked on legacy
code, I had to learn all of the semantics for all of the perl versions
that the company's code worked with up to the versions because some
things were subtly different across versions. Luckily in my case the
code was really major upgrades (Perl 4, Perl 5.6.1, Perl 5.8.8)
because they upgraded the production perl infrequently, but I did get
bit by things like a change in split() around 5.8.1 that slowed it
down about 10%.

At least with the proposed syntax there should be a flag stating what
semantics are *expected* so the new guy can go and research what they
were. Trying to track down that split() thing was a nightmare because
I had no clue where to start back then.

It won't be perfect, but it should be better than what we have now.

-Chris

Thread Previous | 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