Can I extend iex helpers?

So Code.load_file didn’t work, but I found a solution:

  1. create a helper module (cd ~ && vim my_helpers.ex)
  2. compile the helper module (elixirc my_helpers.ex)
  3. add an import statement to .iex.exs (import MyHelpers)
  4. 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! :slight_smile:

1 Like