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:
Yuki Kimoto
Date:
February 15, 2021 01:47
Subject:
Re: Looking for someone to adopt adding trim() to core
Message ID:
CAExogxMrZzngVVu0r3-Vzhe49mTb+63C=8iTos+spA_RUy=LSQ@mail.gmail.com
> 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