|
|
|
@ -2,10 +2,10 @@ use super::*;
|
|
|
|
|
use blonkus_ma::nat_call; |
|
|
|
|
|
|
|
|
|
macro_rules! nat_binop { |
|
|
|
|
( $id:literal , $name:ident , $op:expr ) => { |
|
|
|
|
( $id:literal , $name:ident , $op:tt ) => { |
|
|
|
|
#[nat_call($id, (i64) |i64, i64| -> i64)] |
|
|
|
|
fn $name(x: i64, y: i64) -> i64 { |
|
|
|
|
$op |
|
|
|
|
x $op y |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
@ -15,10 +15,10 @@ fn dbgi(n: i64) {
|
|
|
|
|
eprintln!("{}", n); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
nat_binop!("i+", addi, x + y); |
|
|
|
|
nat_binop!("i-", subi, x - y); |
|
|
|
|
nat_binop!("i*", muli, x * y); |
|
|
|
|
nat_binop!("i/", divi, x / y); |
|
|
|
|
nat_binop!("i%", remi, x % y); |
|
|
|
|
nat_binop!("i+", addi, +); |
|
|
|
|
nat_binop!("i-", subi, -); |
|
|
|
|
nat_binop!("i*", muli, *); |
|
|
|
|
nat_binop!("i/", divi, /); |
|
|
|
|
nat_binop!("i%", remi, %); |
|
|
|
|
|
|
|
|
|
// EOF
|
|
|
|
|