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

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

Thread Previous | Thread Next
From:
Ricardo Signes
Date:
August 24, 2012 17:43
Subject:
Re: fixing smartmatch just hard enough (and when, too)
Message ID:
20120825004329.GC28396@cancer.codesimply.com
* Jesse Luehrs <doy@tozt.net> [2012-08-24T09:00:20]
> On Fri, Aug 24, 2012 at 02:51:35PM +0200, Leon Timmermans wrote:
> > I guess. Conceptually left handed matching and right handed matching
> > feel like completely different, because left hand is usually about the
> > $self and right handed is about the $other, to the point where I'd
> > almost suggest making them separate for purposes of operator
> > overloading.
> 
> Yes, I think that at the very least we should do this. Almost nothing
> makes sense to appear on both the left and right sides of a smartmatch
> (junctions being the only exception I can think of). Smartmatch isn't
> commutative, so every single smartmatch overload will need to look like
> [...disjunct...] 

I do like the idea, but it's a break from existing overloading on
non-commutative operators, which are now expected to act just as you described.
I think this needs to be done, if it's done, with great trepedation.

-- 
rjbs

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