develooper Front page | perl.perl5.porters | Postings from August 2021

Re: Pre-RFC: Real "boolean" SV type

Thread Previous | Thread Next
Paul "LeoNerd" Evans
August 4, 2021 15:50
Re: Pre-RFC: Real "boolean" SV type
Message ID:
On Wed, 04 Aug 2021 17:44:39 +0200
Tomasz Konojacki <> wrote:

> What are 'true' and 'false' exactly? Are they synonyms for !!1 and !!0
> or are they brand new values that stringify to "true" and "false"?

Same thing. I'd suggest having the existing PL_sv_no and PL_sv_yes
constants be SVt_BOOL, and then any existing expression already yields
those. `true` and `false` become new keywords that are just synonyms
for !!1 and !!0 respectively.

As to stringification, while it would be lovely to have them stringify
to "true" and "false", that won't be possible without breaking basically
eeeeeeverything. Which is a bit annoying. :/

Paul "LeoNerd" Evans      |  |

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About