• calcopiritus@lemmy.world
    link
    fedilink
    arrow-up
    5
    ·
    2 hours ago

    Funny that you put rust as the “uses parenthesis for function calls”. When in rust you can use any bracket for macro invocations:

    let v1 = vec!(1,2,3);
    let v2 = vec![1,2,3];
    let v3 = vec!{1,2,3};
    

    These are valid and have the exact same meaning.

    • Flipper@feddit.org
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 hour ago

      To be fair, with Rust macros anything goes. There was an example where someone demoed descriping rust structs and enums nested as xml with a macro to parse it.

    • ExperimentalGuy@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      1 hour ago

      That’s always funny to me. In a language that’s so particular about different syntax features, they let macros of all things have a little bit of arbitrariness.