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

Custom infix operators (was: feature request: string-or)

Thread Next
From:
Peter Martini
Date:
August 4, 2013 15:34
Subject:
Custom infix operators (was: feature request: string-or)
Message ID:
CAFyW6MT=xDdsHA+HX636S794m=TrNWgC1gj7=y5RCbZghdPbcw@mail.gmail.com
On Sun, Aug 4, 2013 at 1:40 AM, Father Chrysostomos <sprout@cpan.org> wrote:
> Felipe Gasper asked:
>> Where can I find documentation on implementing custom operators in Perl?
>
> Perl currently has no mechanism for custom infix operators.  It has
> been discussed a few times, but no serious volunteers have stepped up
> to the challenge.  Peter Martini submitted a demo patch (just a toy),
> but it was barely sufficient, only allowing two precedence levels
> (<https://github.com/PeterMartini/perl/tree/peter/infix>).
>

Of the potential issues with the patch, I hadn't though an
insufficient number of precedence levels would be one of them, the
distinction being, conceptually, like 'and' or like '&&'.  Can you
give more details on what other precedence levels could be offered?

I didn't push any further with the patch mainly because (as far as I
know) the custom operators we have already were designed by Zefram,
and he's not happy with how its currently done, so pushing further
seemed unwise without proper insight into what the problems are.

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