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

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

Thread Previous | Thread Next
Darren Duncan
March 14, 2022 18:05
Re: Pre-RFC: builtin:: functions for detecting numbers vs strings
Message ID:
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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About