Skip to content

Instantly share code, notes, and snippets.

@nathantypanski
Created July 16, 2014 23:36
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 nathantypanski/0d0a83a56ddb8e9623cc to your computer and use it in GitHub Desktop.
Save nathantypanski/0d0a83a56ddb8e9623cc to your computer and use it in GitHub Desktop.
#[feature(macro_rules)];
#![feature(phase)]
#[phase(plugin, link)] extern crate log;
macro_rules! expr (($e: expr) => { $e })
macro_rules! spawn {
($($code: block)*) => {
expr!(spawn(proc() {$($code)*}))
}
}
pub fn main() {
spawn! {
{info!("stmt");}
};
let _ = spawn! {
{info!("expr");}
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment