[erlang-questions] How to avoid copying code?
Fri Nov 24 18:24:48 CET 2006
I have a couple of modules (20-30) which define the same macros, like
And I also have a function in these modules that return the data of
Obviously this function definition is exactly the same in all 20-30
modules, which I don't really like. Is there a way to define this
function only once? In Java I'd create an abstract ancestor class for
module1 and module2, declare the FOO and BAR variables there, also
implement the get_data() in the ancestor class and assign values to FOO
and BAR in the constructor of module1 and module2 (there is only one
instance of module1, etc. classes in the program).
"Beware of bugs in the above code; I have only proved it correct, not
More information about the erlang-questions