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

Re: fixing smartmatch (again (still))

Thread Previous | Thread Next
From:
David Golden
Date:
August 28, 2012 15:53
Subject:
Re: fixing smartmatch (again (still))
Message ID:
CAOeq1c9C6OdH8+pjWbvmEotR-rVj8WvpyjzFx_GqUY8BV-VJ=g@mail.gmail.com
On Tue, Aug 28, 2012 at 5:06 PM, Jesse Luehrs <doy@tozt.net> wrote:

> I think people will have fewer reservations about accepting weird
> special cases like this for a keyword-based control structure
> (especially considering the precedent set by while (<>), etc) than for
> an infix operator (since it will be a weird special case either way -
> "why can i do '$foo ~~ 1', but not '$a = 1; $foo ~~ $a'?".
>
>
The opportunity for confusion exists either way.  My suggestion is to
change *one* thing -- smartmatch -- instead of *two* things -- smartmatch
and when.

Then all people have to know/relearn is the smartmatch table, not the
smartmatch table *and* the special case rules for when.

David

-- 
*David Golden* <dagolden@cpan.org>
*Take back your inbox!* → http://www.bunchmail.com/
Twitter/IRC: @xdg

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