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

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

Thread Previous | Thread Next
From:
Paul "LeoNerd" Evans
Date:
August 4, 2021 15:50
Subject:
Re: Pre-RFC: Real "boolean" SV type
Message ID:
20210804165027.3dc9e925@shy.leonerd.org.uk
On Wed, 04 Aug 2021 17:44:39 +0200
Tomasz Konojacki <me@xenu.pl> 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

leonerd@leonerd.org.uk      |  https://metacpan.org/author/PEVANS
http://www.leonerd.org.uk/  |  https://www.tindie.com/stores/leonerd/

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