Last active
August 29, 2015 14:04
-
-
Save SiegeLord/e138fd609cb7c29e0662 to your computer and use it in GitHub Desktop.
custom_operators
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
operator_rules! my_awesome_operators | |
{ | |
unary($b ^) : right(5) => | |
{ | |
$a.fact() | |
}, | |
trinary($a ^ $b : $c) => | |
{ | |
if $a { $b } else { $c } | |
} | |
} | |
#[my_awesome_operators] | |
fn main() | |
{ | |
let bb = 5^ == 120 ^ true : false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment