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

Re: Revisiting trim

Thread Previous | Thread Next
Scott Baker
May 27, 2021 16:36
Re: Revisiting trim
Message ID:
On 5/26/21 1:20 PM, Neil Bowers wrote:
>   * We think we should add a single function to Perl.
>   * It should return the trimmed string.
>   * It should be called "trimmed", not "trim".
> This is not a mandate, but it is our recommendation.

As the original author of this I appreciate the clear and concise
response. Thank you PSC for continuing to meet and discuss these issues
and provide guidance.

Personally I'd prefer *trim()* instead of *trimmed()* just for
consistency with other languages:

  * PHP = trim() <>
  * Javascript = trim()
  * Raku = trim() <>
  * Go = trim()
  * Vimscript = trim()
  * PowerShell = trim()
  * VBA = trim() <>
  * C# = trim()
  * String::Util = trim()
  * Text::Trim = trim() <>
  * Lisp = string_trim() <>
  * Python = strip()
  * Ruby = strip()

If we go with *trimmed()* we'll definitely be an outlier. Since the PSC
has agreed this is a valuable feature, and should be included in core
(bike shedding is done), the only thing left to debate before we have a
final implementation is the name.

I'd like to being work in earnest next Monday on this feature. Can we
debate the best name here for a couple days so I can begin work on the
final feature? I have a large rebase on the PR to do, and some other

- Scott

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About