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

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

Thread Previous | Thread Next
From:
Leon Timmermans
Date:
September 1, 2012 07:45
Subject:
Re: fixing smartmatch just hard enough (and when, too)
Message ID:
CAHhgV8j2hpoOjP1moGXFUg2Ufi2Do7PRLTXdOMTMUv-dRhn3mg@mail.gmail.com
On Sat, Sep 1, 2012 at 4:33 PM, Aaron Priven <aaron@priven.com> wrote:
> is it possible to add a binary infix operator in a Perl 5 module?

I don't think so (though never say never, who knows what edge-case
someone may be able to find). You could use the keywords mechanism to
some degree for named operators, but I suspect you can't get the
precedence right for most purposes (at least on the left side). I
think it could be very useful to have this ability, but AFAIK that'd
be non-trivial to implement.

Leon

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