Change #macro to macro_rules! in some cases.

This commit is contained in:
Paul Stansifer
2012-07-26 10:14:01 -07:00
parent 7f5fbd4f9d
commit f4c093c4af
3 changed files with 36 additions and 47 deletions

View File

@@ -60,11 +60,8 @@ fn from_value<A>(+val: A) -> future<A> {
})
}
fn macros() {
#macro[
[#move[x],
unsafe { let y <- *ptr::addr_of(x); y }]
];
macro_rules! move{
{$x:expr} => { unsafe { let y <- *ptr::addr_of($x); y } }
}
fn from_port<A:send>(-port: future_pipe::client::waiting<A>) -> future<A> {
@@ -81,7 +78,7 @@ fn from_port<A:send>(-port: future_pipe::client::waiting<A>) -> future<A> {
port_ <-> *port;
let port = option::unwrap(port_);
alt recv(port) {
future_pipe::completed(data) { #move(data) }
future_pipe::completed(data) { move!{data} }
}
}
}