Your own behaviours

Martin Bjorklund <>
Tue Sep 4 16:18:22 CEST 2001


Lennart Öhman <> wrote:
> Hi!
> 
> Mandatory callback functions, among other things, are defined
> in the module otp_internal. This module is used when compiling
> modules having -behavior attribute.
> 
> If you wish to extend your OTP with your own behaviors, otp_internal
> must (should) be changed.
> 
> My suggestion is that the functions in the otp_internal are changed to
> look for the "answers" in the generic module corresponding
> to the behaviour at hand. In this way you do not need to change
> modules belonging to the original system. But instead only program
> a set of required functions in any new behaviour you invent.

Yes, I definitely agree!  We should have done this from the start.  I
think Uffe Wiger suggested this some time ago also.  [Right, I see
now that he did, I also commented on that one: 
http://www.erlang.org/ml-archive/erlang-questions/200102/msg00100.html]

It's pretty trivial to fix in erl_lint.erl.

Of course, you'd have to make sure that the compiled behaviour module
is in the compiler's path, but I think that should be up to the
developer (e.g. by using .erlang).


/martin



More information about the erlang-questions mailing list