Hi all,
I have many modules that looks the same:
-module(m_one).
-behaviour(some_behaviour).
-export([some_f/2]).
some_f(X, Y) ->
...
M = helpers:m_of(?MODULE)
Z = erlang:apply(M, some_function, [])
...
-module(m_two).
-behaviour(some_behaviour).
-export([some_f/2]).
some_f(X, Y) ->
...
M = helpers:m_of(?MODULE)
Z = erlang:apply(M, some_function, [])
...
The only thing that changes in these modules is the M
variable.
Is there a way to avoid repeating some_f
in every single module?
Thank you.
Cheers!