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

Re: fixing smartmatch just hard enough (and when, too)

Thread Previous | Thread Next
From:
John Wiersba
Date:
August 25, 2012 16:38
Subject:
Re: fixing smartmatch just hard enough (and when, too)
Message ID:
1345937922.68107.YahooMailNeo@web161501.mail.bf1.yahoo.com
From: Ricardo Signes <perl.p5p@rjbs.manxome.org>
>To: perl5-porters@perl.org 
>Sent: Saturday, August 25, 2012 7:02 PM
>Subject: Re: fixing smartmatch just hard enough (and when, too)
> 
>Good, because I have favored that working-with-warning behavior for ambiguous
>simple scalars.  (What about `$x ~~ $glob`?  That's where I liked
>undef-and-warn.)
>I can't say I favor working-with-warning.  I prefer working-with-good default, with a way for the caller to specify how strings are to be interpreted.  Default to eq with a simple syntax to switch to interpret-as-numbers.  If you don't do this, then people (like me) will shy away from it as being too likely to cause an unexpected and unpredictable warning at runtime.  Warnings are great, but you need to be able to predict them and prevent them with proper coding and/or testing.  If you can't do that, then you have an unstable program (which is almost useless).
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