Reusing function in the module

Senthilkumar Peelikkampatti <>
Tue Dec 22 18:57:19 CET 2009


I wanted to know what are the ways by which we can reuse functions
with pure functional sense. Is that good to use extends
(http://www.erlang.org/euc/07/papers/1700Carlsson.pdf)

These are my requirements
I have mod1.erl, mod2.erl etc

mod1.erl - has different falovor of save and its utility functions
mod2.erl - has update and its utility functions
mod3.erl -- has same functions as mod1 but few more functions specific
to itself. It is normally solved by either composition or inheritance
in OOP. Borrowing a leaf from Joe's book (page 47-49), I can use
pattern matching to do that. Here I need to club everything together
and use different varient of pattern for variance of functionality.
Is there any other way?


-- 
Regards,
Senthilkumar Peelikkampatti,
http://pmsenthilkumar.blogspot.com/


More information about the erlang-questions mailing list