about summary refs log tree commit diff
diff options
context:
space:
mode:
authorKevin Ballard <kevin@sb.org>2013-07-13 14:08:05 -0700
committerKevin Ballard <kevin@sb.org>2013-07-13 14:33:41 -0700
commit3b0258916d28a1215acf9a0c78f6760cc67f935c (patch)
treebf22ede10293f55d6e5c63a7c51b134f27dc6c81
parent8d0feb58e7f5ae67546db9c3cd7fdf4ab792d839 (diff)
downloadrust-3b0258916d28a1215acf9a0c78f6760cc67f935c.tar.gz
rust-3b0258916d28a1215acf9a0c78f6760cc67f935c.zip
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!()).
-rw-r--r--src/libsyntax/ext/expand.rs22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs
index 73fa659a7aa..2c3f42cca9a 100644
--- a/src/libsyntax/ext/expand.rs
+++ b/src/libsyntax/ext/expand.rs
@@ -644,16 +644,22 @@ pub fn core_macros() -> @str {
         );
     )
 
-    macro_rules! print(
-        ($( $arg:expr),+) => ( {
-            print(fmt!($($arg),+));
-        } )
+    macro_rules! printf (
+        ($arg:expr) => (
+            print(fmt!(\"%?\", $arg))
+        );
+        ($( $arg:expr ),+) => (
+            print(fmt!($($arg),+))
+        )
     )
 
-    macro_rules! println(
-        ($( $arg:expr),+) => ( {
-            println(fmt!($($arg),+));
-        } )
+    macro_rules! printfln (
+        ($arg:expr) => (
+            println(fmt!(\"%?\", $arg))
+        );
+        ($( $arg:expr ),+) => (
+            println(fmt!($($arg),+))
+        )
     )
 }";
 }