summaryrefslogtreecommitdiff
path: root/exercises/macros/macros1.rs
diff options
context:
space:
mode:
Diffstat (limited to 'exercises/macros/macros1.rs')
-rwxr-xr-xexercises/macros/macros1.rs64
1 files changed, 64 insertions, 0 deletions
diff --git a/exercises/macros/macros1.rs b/exercises/macros/macros1.rs
new file mode 100755
index 0000000..a7c78a5
--- /dev/null
+++ b/exercises/macros/macros1.rs
@@ -0,0 +1,64 @@
+// macros1.rs
+// Make me compile! Scroll down for hints :)
+
+macro_rules! my_macro {
+ () => {
+ println!("Check out my macro!");
+ };
+}
+
+fn main() {
+ my_macro();
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// When you call a macro, you need to add something special compared to a
+// regular function call. If you're stuck, take a look at what's inside
+// `my_macro`.