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

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

Thread Previous
From:
Karl Williamson
Date:
May 31, 2017 23:42
Subject:
Re: RFC: Add new string comparison macros in handy.h
Message ID:
472ebd2d-eb8a-ae69-ce90-04e3af2289b9@khwilliamson.com
On 05/31/2017 05:16 PM, Ricardo Signes wrote:
> * 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.
> 

I like these, and will implement them if I don't hear contrary opinions 
soon.

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About