Skip to content

Instantly share code, notes, and snippets.

@durka
Last active May 13, 2018 14:21
Show Gist options
  • Save durka/2ee881c35927d84935c9cd4e9b292dcb to your computer and use it in GitHub Desktop.
Save durka/2ee881c35927d84935c9cd4e9b292dcb to your computer and use it in GitHub Desktop.
[package]
name = "a"
version = "0.1.0"
authors = ["Alex Burka <[email protected]>"]
[dependencies]
static-cond = "*"
#![feature(use_extern_macros)]
extern crate static_cond;
pub use static_cond::static_cond;
#[macro_export]
macro_rules! a {
($x:tt, $y:tt, $z:tt) => {
static_cond! { if $x == $y { $z } }
}
}
[package]
name = "b"
version = "0.1.0"
authors = ["Alex Burka <[email protected]>"]
[dependencies]
a = { path = "../a" }
#![feature(use_extern_macros)]
extern crate a;
use a::{static_cond, a};
fn main() {
a!(true, true, { println!("Hello, world!"); });
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment