• Killing_Spark@feddit.de
    link
    fedilink
    arrow-up
    8
    ·
    1 year ago

    mod name declares that the module should be compiled and reachable as a submodule of the current module. This assumes that you have a file or directory of the name in the right place. This is what you should do.

    You can also declare a module like this: mod name {...} where you just put the content in the block. The two are functionally equivalent, from the compilers perspective.

    • meteokr@community.adiquaints.moe
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      I don’t understand how to follow this bullet point that I was replying to.

      do not use mod unless it’s test for the current module. No I don’t want to Star Wars scroll your 1000 line file. Split it.

      I already know what mod does in a basic sense, I wanted to know what the commenter meant by this.