So Code.load_file
didn’t work, but I found a solution:
- create a helper module (
cd ~ && vim my_helpers.ex
) - compile the helper module (
elixirc my_helpers.ex
) - add an import statement to
.iex.exs
(import MyHelpers
) - test in
iex
What happens is that iex
auto-loads the compiled beam file - then you can auto-import the helper module in .iex.exs
.
You can tweak the beam-path by hacking the iex
shell script (at /usr/local/bin/iex
).
@gregvaughn thanks for your suggestions!