Challenge 1: A max_of_two! Macro — Possible Solution ==================================================================== macro_rules! max_of_two { ($a:expr, $b:expr) => { if $a > $b { $a } else { $b } }; } fn main() { let result = max_of_two!(3, 7); println!("{}", result); // 7 } WHY THIS WORKS AS AN ANSWER ------------------------------ The pattern ($a:expr, $b:expr) captures TWO separate expression fragments, using two distinct metavariables — a direct extension of this chapter's single-metavariable square! example to a two-argument case, following the same $name:expr syntax for each. The expansion — if $a > $b { $a } else { $b } — is ordinary Rust code with $a and $b substituted in wherever they appear, exactly this chapter's core definition of what a macro does: it produces Rust syntax as output, which is then compiled normally as if it had been written by hand at the call site. Calling max_of_two!(3, 7) expands, at compile time, into if 3 > 7 { 3 } else { 7 } — an ordinary if/else expression evaluating to 7, which becomes result's value. Since $a and $b are expression fragments (not just literals), this macro also works correctly with more complex expressions passed in, like max_of_two!(x + 1, y * 2), not just bare numeric literals.