develooper Front page | perl.perl5.porters | Postings from November 2020

Re: Looking for someone to adopt adding trim() to core

Thread Previous | Thread Next
From:
Christian Walde
Date:
November 18, 2020 20:03
Subject:
Re: Looking for someone to adopt adding trim() to core
Message ID:
op.0uam9si9ydyjqt@xenwide.vpn.udag.de
On Wed, 11 Nov 2020 22:00:55 +0100, Corwin Brust <corwin@bru.st> wrote:

> Thank you for your reply!
>
> On Wed, Nov 11, 2020 at 11:48 AM demerphq <demerphq@gmail.com> wrote:
>>
>> On Wed, 11 Nov 2020 at 18:32, Corwin Brust <corwin@bru.st> wrote:
>> >
>> > Hi!  Long-time listener, first-time caller.
>> >
>> > On Wed, Nov 11, 2020 at 10:34 AM Konovalov, Vadim
>> > <Vadim.Konovalov@dell.com> wrote:
>> > >
>> > > Absolutely agree.
>> > > Please add my voice to the pool, and count it carefully.
>> > >
> [snip]
>> Things that are exposed as normal functions in a namespace are
>> trivially back portable:
>
> Why is back-portability an important concern when discussing features
> proposed for future perls?

There is some concern when a perl is asked to run code written for an older perl.

If a v5.20 perl script defines a trim function, then loading it automatically can cause a conflict.

So two other things must be done:

- either implement trim as a feature that is loaded by way the feature module or `use 5.032;` which scopes the export to chosen code

Apparently there are SOME issues with doing it via feature (yves hasn't explained which) IF backporting (making it so that code using it can be run without errors by a 5.20 perl AND a 5.32 perl) is a concern for you.

So the proposed option is:

- trim gets implemented into a specific namespace that doesn't exist yet to allow easier backporting

HOWEVER

This ignores that trim is so trivial that even remembering what the backporting module is is more work than just writing it as a regex.

Backporting is a concern for people who post code to CPAN. But trim is aimed at users.

As such backporting is actually not a concern here.

And additionally putting it into a special namespace is a very new idea and has not been done for any perl feature that is comparable to what trim is, and policies etc. would need to be discussed for it and be an effort completely outsized to what trim gives.

-- 
With regards,
Christian Walde

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