[erlang-questions] multiple behaviours

Tony Rogvall <>
Wed Jun 6 15:33:15 CEST 2012


On 6 jun 2012, at 14:13, Samuel wrote:

>> I am compiling the canopen stack (git://github.com/tonyrog/canopen.git) and
>> get the following warning:
>> 
>> ../src/co_os_app.erl:37: Warning: conflicting behaviours - callback
>> index_specification/2 required by both 'co_stream_app' and 'co_app' (line
>> 36)
>> 
>> The question is:
> 
> And no question followed ;)
> 
> Ideally you could suppress the warning as you really intend to share
> the same function for both behaviours, but as far as I know there is
> not such an option in the compiler, so you either suppress all
> warnings for that module or learn to live with this one.
> 
Yupp.

> Or, as you also suggest, write a new behaviour combining those two. If
> this situation is not common in your design I would suggest this
> solution as prevents you from going against what I think is the
> intended use of behaviours. I guess the original idea was to have at
> most a behaviour per module, but more authoritative voices may have a
> word about this.
> 
Any takers on this topic (meaning people involved in the design of course)

> If you was planning to have many of those behaviour combinations, the
> second option seems bad idea, as the result could be messy.
> 
Thanks. 
Wow, someone answered a question sent 7 days ago :-)

/Tony




More information about the erlang-questions mailing list