develooper Front page | perl.perl5.porters | Postings from March 2022

Re: Pre-RFC: builtin:: functions for detecting numbers vs strings

Thread Previous | Thread Next
From:
Glenn Golden
Date:
March 14, 2022 17:43
Subject:
Re: Pre-RFC: builtin:: functions for detecting numbers vs strings
Message ID:
695e5c60-e6eb-4504-8a28-19c6addee3b6@www.fastmail.com
On Mon, Mar 14, 2022, at 11:24, Martijn Lievaart wrote:
> Op 14-03-2022 om 11:53 schreef Ovid via perl5-porters:
>> On Monday, 14 March 2022, 06:37:26 CET, Darren Duncan <darren@darrenduncan.net> wrote:
>>
>>> I made good name proposals already:
>>>
>>>   - is_canonically_a_number()
>>>   - is_canonically_a_string()
>>>   - is_canonically_a_boolean()
>> Naming is hard. Very hard. It's even harder when many people are non-native English speakers. I'm a native English speaker and a writer and it wasn't clear to me that "canonically" is appropriate here. I hit dictionary.com (https://www.dictionary.com/browse/canonically) and not a single definition appears to fit the meaning of this as I understand it. You could check other dictionaries, such as Merriam-Webster, Collins, etc., and again, canonically doesn't quite seem to fit (Collins seem the closest to what you're saying https://www.collinsdictionary.com/dictionary/english/canonical)
>>
>> The most accurate description I can think of is something like:
>>
>>      was_initialized_as_number()
>>
>> But we don't do past-tense, so perhaps the slightly awkward:
>>
>>      is_initialized_as_number()
>>
>
> For me as a non-native, was_initialized_as_number() seems to me to be 
> the best purveyor of the meaning intented. So do use the past tense afaic.
>
>
> HTH,
>
> M4
>

2c: How about born_as_XXX()?  The adjective "birth" has some precedent:
It's used by GNU coreutils stat(1) in reports on file times, and in the
associated man page. Shorter than "was_initialized", and the past tense
is implied. 

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