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 14, 2022 18:05
Subject:
Re: Pre-RFC: builtin:: functions for detecting numbers vs strings
Message ID:
459b64d3-ebba-c8b2-e29f-3b40c2ecfe77@darrenduncan.net
Okay, so how about this instead?

- is_intended_as_boolean()
- is_intended_as_number()
- is_intended_as_string()

If the problem with "classify" is that we are "telling" the serializer what to 
do rather than suggesting the "intent" of the value but still letting them 
decide for themselves, then maybe "intended" is better, and also it is shorter.

-- Darren Duncan

On 2022-03-14 10:59 a.m., Darren Duncan wrote:
> On 2022-03-14 10:53 a.m., Dan Book wrote:
>> We are not discussing classification of values. Again, please bring that up in 
>> threads about typing and not here.
> 
> Are these functions not about giving JSON serializers and other similar tools 
> the information they need to pick an output format like a number or a string?
> 
> If so then I see type classifying is exactly what we're doing, because each of 
> these tends to correspond directly to a serialization syntax.
> 
> If that use case is not what these functions are for, then what are they for?
> 
> -- 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