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

Re: RFC: Add new string comparison macros in handy.h

Thread Previous | Thread Next
From:
Ricardo Signes
Date:
May 31, 2017 23:16
Subject:
Re: RFC: Add new string comparison macros in handy.h
Message ID:
20170531231644.GA3500@debian
* Karl Williamson <public@khwilliamson.com> [2017-05-11T11:22:42]
> I would like to add the macros given below to handy.h.  The situations they
> handle occur reasonably frequently in the core, and these can save
> developers from thinking they have to manually count the characters in a
> string.
> 
> I am not confident at all about the names, and would like to see if people
> have better ones.

I had a talk to Karl today about these, and here were my tentative suggestions:

>     strSTARTS_WITHs
>     memSTARTS_WITHs

strSUBSTR_STARTs
memSUBSTR_STARTs

>     memENDS_WITHs

memSUBSTR_ENDs

>     memFOO_STARTING_WITHs
>     memFOO_ENDING_WITHs

memPSUBSTR_STARTs
memPSUBSTR_ENDs

Here, the "P" is for "proper," as only a proper substring will be matched.

-- 
rjbs

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