Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Hints Towards Writing a Module with New Operators

by moritz (Cardinal)
on Dec 19, 2009 at 22:48 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://813563]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2024-04-19 09:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found