[erlang-questions] How to avoid copying code?

Bengt Kleberg <>
Mon Nov 27 08:57:38 CET 2006


On 2006-11-25 11:53, Mazen wrote:
...deleted
> 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

how about having one module with the common code for this function, and 
then let all 20-30 other modules call this module for the common parts 
and only supply the module specific things (like values) on the 20-30 
modules?


bengt
-- 
    EPO guidelines 1978: "If the contribution to the known art resides
    solely in a computer program then the subject matter is not
    patentable in whatever manner it may be presented in the claims."



More information about the erlang-questions mailing list