From 47576313695170013cfe07d57e81c2e879a14c14 Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Wed, 18 Sep 2013 07:21:57 -0400 Subject: Remove and replace cond! Closes #9282. --- src/libsyntax/ext/expand.rs | 36 ------------------------------------ 1 file changed, 36 deletions(-) (limited to 'src/libsyntax/ext') diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index ac094c27a81..5163642e484 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -898,42 +898,6 @@ pub fn std_macros() -> @str { } ) - // - // A scheme-style conditional that helps to improve code clarity in some instances when - // the `if`, `else if`, and `else` keywords obscure predicates undesirably. - // - // # Example - // - // ~~~ - // let clamped = - // if x > mx { mx } - // else if x < mn { mn } - // else { x }; - // ~~~ - // - // Using `cond!`, the above could be written as: - // - // ~~~ - // let clamped = cond!( - // (x > mx) { mx } - // (x < mn) { mn } - // _ { x } - // ); - // ~~~ - // - // The optional default case is denoted by `_`. - // - macro_rules! cond ( - ( $(($pred:expr) $body:block)+ _ $default:block ) => ( - $(if $pred $body else)+ - $default - ); - // for if the default case was ommitted - ( $(($pred:expr) $body:block)+ ) => ( - $(if $pred $body)else+ - ); - ) - // NOTE(acrichto): start removing this after the next snapshot macro_rules! printf ( ($arg:expr) => ( -- cgit 1.4.1-3-g733a5