Skip to content

Instantly share code, notes, and snippets.

@SiegeLord
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SiegeLord/e138fd609cb7c29e0662 to your computer and use it in GitHub Desktop.
Save SiegeLord/e138fd609cb7c29e0662 to your computer and use it in GitHub Desktop.
custom_operators
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