[erlang-questions] OOP in Erlang

Ulf Wiger <>
Thu Aug 12 10:03:04 CEST 2010


I agree that -extend(Mod) seems like it would solve this.
I have not used it myself yet and am not yet ready to have
a firm opinion about whether that is the way to go.

To be clear, it does address something that has occasionally
bugged me, but I've not considered it a big enough problem
that I've made it a priority to evaluate it.

BR,
Ulf W

Fred Hebert wrote:
> On Wed, Aug 11, 2010 at 6:24 AM, Ulf Wiger 
> < <mailto:>> 
> wrote:
> 
> 
>     In short, I have not missed OO when using Erlang in its original
>     domain. I have, on occasion, missed being able to conveniently
>     extend modules and override individual functions when working
>      on other things (e.g. like extending mnesia). 
> 
>     BR,
>     Ulf W
> 
> 
> I believe you use mnesia:activity/4 to do this (change the callback 
> module), but wouldn't the -extend(Mod) module attribute solve your 
> problem (even in the case of mnesia?). As far as I know, it does exactly 
> that: override functions and leave the others to be called from 'Mod' 
> when they are undefined. Any reason why this wouldn't do or why you 
> [maybe] dislike the feature? 

-- 
Ulf Wiger
CTO, Erlang Solutions Ltd, formerly Erlang Training & Consulting Ltd
http://www.erlang-solutions.com


More information about the erlang-questions mailing list