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:
Yuki Kimoto
Date:
November 25, 2020 04:58
Subject:
Re: Looking for someone to adopt adding trim() to core
Message ID:
CAExogxO7t=HtDfy6=hKy+Jo9fTD4469SQFCLGUm_eXuG3pt75A@mail.gmail.com
> say is also "just a function" and is extremely similar in many ways. To
treat trim any different from say requires extremely strong arguments to
explain how it is different from say.

First, I think it is necessary to discuss the frequency of use.

Personally, I think say is used every time in almost every script.

On the other hand, I think trim is used for specific purposes such as
editing web input.

Even if it's a function, if it's obvious that it's used quite often, the
function might consider putting it in the main/CORE namespace.


2020年11月19日(木) 8:03 Christian Walde <walde.christian@gmail.com>:

> The point is to minimize the work a non-cpan developer has to do to have
> access to the function.
>
> Precisely because it's implementation is so small, in the range of the
> code needed for say, it must also be able to be used with minimum effort.
>
> The suggestions you have, of tracking dependencies beyond Perl version,
> would increase the work-to-use needed to a point where the entire
> undertaking is wholly pointless.
>
>
> Also, to be frank, nothing you said actually adresses the email you
> replied to. At all.
>
>
> say is also "just a function" and is extremely similar in many ways. To
> treat trim any different from say requires extremely strong arguments to
> explain how it is different from say.
>
>
> On Wed, 18 Nov 2020 23:31:41 +0100, Yuki Kimoto <kimoto.yuki@gmail.com>
> wrote:
>
> I think trim is just a function.
>
> The function means that it takes arguments and returns return value.
>
> I think the benefits of adding trim as a Perl grammar are small.
>
> I think it's a best idea to add trim to Scalar::Util.
>
> use Scalar::Util 'trim';
>
> trim $string;
>
> The reason is that there are a few changes and the benefits are great.
>
> I think The next best idea is to add a new namespace.
>
> use Scalar 'trim';
>
> trim $string;
>
> This adds a new namespace, or module, so the size of the changes will be a
> bit larger.
>
>
> 2020年11月19日(木) 5:20 Christian Walde <walde.christian@gmail.com>:
>
>> One more note:
>>
>> say is EXTREMELY similar to trim, and as far as i can tell was VERY well
>> received and caused no significant issues. Right?
>>
>> --
>> 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