How to make an Elixir library available to erlang users?

In Erlang, module names must be atoms. For simplicity, to avoid the simple quotes, the common way is to use a module name with lower case characters, underscores and numbers only. The same thing is true for record names.

I understand it might be boring typing 'Elixir.X.Y':some_fun() from erlang source code, especially it there are many calls.
If someone’s not happy with that, there’s a quite simple solution which consists in adding a define for the module name and use it.

-define(LIB,  'Elixir.X.Y').

and perform calls like this:

?LIB:some_fun(),
?LIB:some_other_fun(),
2 Likes