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

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

Thread Previous | Thread Next
From:
Jesse Luehrs
Date:
August 24, 2012 05:36
Subject:
Re: fixing smartmatch just hard enough (and when, too)
Message ID:
20120824123632.GE11137@tozt.net
On Fri, Aug 24, 2012 at 10:14:03PM +1000, Damian Conway wrote:
> I wish I had a good short-term solution as well, but I don't. We're
> trying to add an essentially non-auto-coercive feature to an essentially
> auto-coercive language, and the simple scalar as LHS is the single point
> at which we get stuck between those two world-views.
> 
> Some would say that's reason enough to abandon smartmatching
> (because it's intrinsically different from most of the other Perl 5 operators).

Well, no - the string/number distinction is the only place where this is
the case (and this is a deep part of the language - perl basically
always infers type from the operators rather than the operands, annoying
exceptions like the bitwise operators notwithstanding). If we just drop
that part of the proposal, everything else works fine (and would still
let you be explicit about numeric matching if that's what you really
wanted).

-doy

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