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

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

Thread Previous | Thread Next
Aaron Priven
August 4, 2021 22:30
Re: Pre-RFC: Real "boolean" SV type
Message ID:
I don’t have a problem with the proposal per se, but it’s hard for me to believe that inferring what type a value should be from its initial assignment is going to be reliable.

Surely there’s a lot of extant code like

  if ($condition) {
     $flag = $x eq $y;
  } else {
     $flag = 1;
  $count+= $flag;

Is $flag a boolean or an integer? 

I can appreciate the desire to have serializers work on data without having to pass type information separately, but it seems really unlikely to me that it’s possible to be consistent without being explicit.

-----Original Message-----
From: Paul "LeoNerd" Evans <> 
Sent: Wednesday, August 4, 2021 10:58 AM
To: Perl5 Porters <>
Subject: Pre-RFC: Real "boolean" SV type

I propose the addition of a new SV type, of SVt_BOOL. Should I write an RFC?

Aaron Priven,,

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