I’m not using a mix project.
If you’re not using mix, then you need to compile by hand.
$ elixirc my_math.ex
Okay, that worked…but it also worked without the require statement, so I guess I don’t understand what require does yet:
As for the code you’ve written, you don’t need a
requirestatement at all. Requires are for loading macros before they’re used, which your function is not (its just a plain function). You can remove therequire MyMathand everything will still work fine.
The problem is that the book I’m reading hasn’t covered macros yet, but in the code examples there are lines with require, use, and import statements.


















