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:
Leon Timmermans
Date:
February 10, 2021 18:24
Subject:
Re: Looking for someone to adopt adding trim() to core
Message ID:
CAHhgV8iGu_MBWxGgHVdBDZmHk-cEzOVee53Xt5Tf6Fg2CwXT1w@mail.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