<div dir="ltr">I still prefer behaviors... <div><br></div><div><span style="line-height: 18px; font-family: 'Courier New';">src/my_evt.erl:5: Warning: undefined callback function handle_info/2 (behaviour 'gen_event')</span></div><div><span style="line-height: 18px; font-family: 'Courier New';"><br></span></div><div>...sometimes "newer" isn't necessarily "better".<br></div><div><br></div><div>/s</div><div><br>On Monday, July 21, 2014 4:08:06 PM UTC-5, Jay Nelson wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">We have created a behaviour with -callbacks, but would like to simplify
<br>the implementation by providing default implementations of some of the
<br>callbacks. Using erlang:function_exported/3 to test for a user-supplied
<br>callback and instead calling a default implementation may work, but the
<br>compiler will complain for the user-defined module if no callback is
<br>supplied. What is the recommended best practice for this situation?
<br>The best I can come up with is to document the default implementation
<br>and leave it up to the user-defined module to call that function or
<br>provide its own so that the callback is always present.
<br>
<br>jay
<br>
<br>______________________________<wbr>_________________
<br>erlang-questions mailing list
<br><a href="javascript:" target="_blank" gdf-obfuscated-mailto="vQy3rfUsDkYJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">erlang-q...@erlang.org</a>
<br><a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Ferlang.org%2Fmailman%2Flistinfo%2Ferlang-questions\46sa\75D\46sntz\0751\46usg\75AFQjCNH15VBDH9qL9o1Zx3x6ZeLmwvUvTg';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Ferlang.org%2Fmailman%2Flistinfo%2Ferlang-questions\46sa\75D\46sntz\0751\46usg\75AFQjCNH15VBDH9qL9o1Zx3x6ZeLmwvUvTg';return true;">http://erlang.org/mailman/<wbr>listinfo/erlang-questions</a>
<br></blockquote></div></div>