Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Hints Towards Writing a Module with New Operators

by moritz (Cardinal)
on Dec 19, 2009 at 22:48 UTC ( #813563=note: print w/replies, xml ) Need Help??


in reply to Hints Towards Writing a Module with New Operators

Take a look at Devel::Declare, if I remember correctly it allows you to install callbacks in the parser for things that are otherwise syntax errors.

In Perl 6 you could just declare the operators:

use v6; multi sub infix:<.EQV.>($x, $y) { $x == $y }; say 1 .EQV. 1; say 1 .EQV. 2;

When you run this with Rakudo, it prints

1 0

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://813563]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2020-05-30 14:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (172 votes). Check out past polls.

    Notices?