Last active
May 13, 2018 14:21
-
-
Save durka/2ee881c35927d84935c9cd4e9b292dcb to your computer and use it in GitHub Desktop.
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
[package] | |
name = "a" | |
version = "0.1.0" | |
authors = ["Alex Burka <[email protected]>"] | |
[dependencies] | |
static-cond = "*" | |
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
#![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 } } | |
} | |
} | |
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
[package] | |
name = "b" | |
version = "0.1.0" | |
authors = ["Alex Burka <[email protected]>"] | |
[dependencies] | |
a = { path = "../a" } | |
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
#![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