Comment

Comment by harikb

For a non-rust person's point of view, I assume a macro is something like a super-pre-processor that helps keep the code concise. In the example below, what portion is written ahead of time (by the person making the macro) and what portion is the macro usage?

  macro_rules! mac_trait {
      ($i:item) => {
          trait T { $i }
      }
  }
  
  mac_trait! {
      fn foo() {}
  }
Is this making it easier to implement a trait? interface?
parent harikb 6 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton