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

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

Thread Previous | Thread Next
Ovid via perl5-porters
August 5, 2021 06:28
Re: Pre-RFC: Real "boolean" SV type
Message ID:
Very much support this idea.
One question, how would it handle this annoyance?

#!/usr/bin/env perl
use strict;use warnings;
my @list    = map { rand(50) } 1 .. 10;my $matches = 0;for (@list) {  $matches += $_ > 25; # ???}print "Matches = $matches\n";

Yes, that's an abuse, but it's the kind of crud we see in the wild (and it doesn't throw any warnings);
Best,Ovid-- IT consulting, training, specializing in Perl, databases, and agile development 
Buy my book! - 

    On Thursday, 5 August 2021, 07:34:36 CEST, Tom Molesworth via perl5-porters <> wrote:  
 On Thu, 5 Aug 2021 at 11:37, Darren Duncan <> wrote:

Thank you!

I fully agree Perl would benefit greatly from having a dedicated boolean type.

Please do keep in mind the original request:
> *: Where "postcard" means: **PLEASE KEEP REPLIES SHORT**. This is a
> pre-RFC question. Replies should be limited to the question of whether
> I should write the RFC - not about the feature itself.
The rest of your reply might be more appropriate *after* the RFC has been written?
Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About