Rename print!()/println!() to printf!()/printfln!()

The new names make it obvious that these generate formatted output.

Add a one-argument case that uses %? to format, just like the other
format-using macros (e.g. info!()).
This commit is contained in:
Kevin Ballard 2013-07-13 14:08:05 -07:00
parent 8d0feb58e7
commit 3b0258916d

View file

@ -644,16 +644,22 @@ pub fn core_macros() -> @str {
); );
) )
macro_rules! print( macro_rules! printf (
($( $arg:expr),+) => ( { ($arg:expr) => (
print(fmt!($($arg),+)); print(fmt!(\"%?\", $arg))
} ) );
($( $arg:expr ),+) => (
print(fmt!($($arg),+))
)
) )
macro_rules! println( macro_rules! printfln (
($( $arg:expr),+) => ( { ($arg:expr) => (
println(fmt!($($arg),+)); println(fmt!(\"%?\", $arg))
} ) );
($( $arg:expr ),+) => (
println(fmt!($($arg),+))
)
) )
}"; }";
} }