develooper Front page | perl.perl5.porters | Postings from February 2021

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

Thread Previous | Thread Next
From:
Christian Walde
Date:
February 15, 2021 02:14
Subject:
Re: Looking for someone to adopt adding trim() to core
Message ID:
op.0yt26qnyydyjqt@xenwide.vpn.udag.de
On Thu, 26 Nov 2020 13:07:41 +0100, Christian Walde <walde.christian@gmail.com> wrote:

> On Thu, 26 Nov 2020 01:34:16 +0100, Tony Cook <tony@develop-help.com> wrote:
>
>> I'm a bit on the fence with trim() in particular, but tend slightly
>> towards including it. I think it would see more usage than chop() for
>> example.
>
> I think a lot of people could even replace their use of chomp() with trim() and actually end up with more useful, or equally useful code afterwards, given that chomp() is just a subset of trim().

i don't know if you truly do not want to see trim in core

or if you're just trying to put up every resistance you can think of to make sure that all objections have been considered

if it's the former: please try to use strong objections. particularly not ones whose meat has already been addressed months ago

-- 
With regards,
Christian Walde

On Mon, 15 Feb 2021 02:47:36 +0100, Yuki Kimoto <kimoto.yuki@gmail.com> wrote:

>> TBH, I think those are all very different cases.
>
> I also think evalbytes and fc and say are special cases.
>
> fc is corresponding to lc, uc
> say is corresponding to print
> evalbytes is corresponding to eval
>
> These are already core keywords.
>
> On the other hand, trim is a mere function.
>
> I feel that it is easier to get consensus by adding functions to the module.
>
>  use SomeModule 'trim';
>
>
> 2021年2月11日(木) 3:24 Leon Timmermans <fawaka@gmail.com>:
>> On Thu, Nov 26, 2020 at 1:35 AM Tony Cook <tony@develop-help.com> wrote:
>>> The same arguments could be made for fc(), say() and evalbytes().
>>
>> TBH, I think those are all very different cases.
>>
>> evalbytes is very much a language primitive, but OTOH is rarely
>> required in user code.
>>
>> fc is arguably also a language primitive, and congruent to the older lc/uc.
>>
>> say is the only one that I would call a utility function (it's a
>> huffmanization of something that can trivially be accomplished using
>> existing primitives). It's still very different from trim in one very
>> important way though: IME it's mainly used in scripts and one-liners,
>> not in large applications. It's also the only utility function we
>> added in the past two decades.
>>
>> trim is clearly a utility function, but one more aimed at module use
>> than scripts. As such it's not entirely comparable with say either.
>> It's more like the functions in List::Util, which we never cored.
>>
>> I am very firmly against this getting added as an ad-hoc decision. If
>> we do this, we should first establish guidelines about what kinds of
>> things we want to add and what kinds not. In particular I would not
>> understand a policy that includes trim but doesn't include much of
>> Scalar::Util.
>>
>> Leon
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