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:
Darren Duncan
Date:
March 18, 2022 00:32
Subject:
Re: Pre-RFC: builtin:: functions for detecting numbers vs strings
Message ID:
07cbc0bb-a2f0-5baf-14c2-3f97be4ea7f4@darrenduncan.net
On 2022-03-17 8:50 a.m., Paul "LeoNerd" Evans wrote:
> On Tue, 15 Mar 2022 14:55:06 +0900 wrote:
> 
>> This is because I don't know the cases that the value is changed after
>> "started".
>>
>> A value is started as a number (3). If the value is used as a string,
>> "3" is maybe cached to the pv slot.
>>
>> A value is started as a string ("3"). If the value is used as a
>> number, 3 is maybe cached to the nv or iv slot.
>>
>> As Darren says, Is the value classified to a string or a number from
>> the starting to the destruction, not only starting?
> 
> Indeed, this is the point of the core perl change, to make the public
> flags reliable and fixed after the value is created. We can now use
> those flags to reliably answer questions about the origin of a value,
> irrespective of any additional cached parts the value has gained as a
> side-effect of being looked at since then.

That's great news, just the kind of thing I like to read. -- Darren Duncan

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