<div dir="ltr"><div><div><div><div><div><div><div><div>Just to throw something completely different and definitely not backwards compatible I would prefer something like:<br><br></div>-callback([foo/2,bar/4]).<br></div>-optional_callback([bar/3,boo/14]).<br><br></div>foo(...) -> ... .<br></div>bar(...) -> ... .<br></div>baz(...) -> ... .<br></div>boo(...) -> ... .<br><br></div>This because it mirrors how -export(). behaves and does not push the information down into the actual definition. I think not seeing it at the start of the module is a bad option as it means I have to step down into the module to see what it exports and, in this case, what are the callbacks. You have to delve down into the module to find this "global" information. I find it very annoying with languages that do this, which is why I purposely followed erlang when doing LFE.<br><br></div><div>Yes, I know it is too late to change it. Is it? Maybe a parse transform to get it right?<br><br></div>Robert<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On 25 September 2014 05:38, Loïc Hoguin <span dir="ltr"><<a href="mailto:essen@ninenines.eu" target="_blank">essen@ninenines.eu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 09/25/2014 03:01 PM, Hans Bolinder wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
[Loïc Hoguin:]<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I didn't get any reply on my previous question almost 2 years ago here:<br>
<a href="http://erlang.org/pipermail/erlang-questions/2013-January/071763.html" target="_blank">http://erlang.org/pipermail/<u></u>erlang-questions/2013-January/<u></u>071763.html</a><br>
</blockquote>
<br>
I missed your original question, otherwise I would have replied to it.<br>
</blockquote>
<br></span>
No worries. :)<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
There is an implementation in Erlang/OTP 18, see commit 683a293, using<br>
the second syntax suggested by Kostis, -optional_callbacks/1.<br>
</blockquote>
<br></span>
Woot!<br>
<br>
This looks great. I guess I'll just have to wait now and play with it a few weeks before 18 gets released.<br>
<br>
Thanks for the heads up!<span class="im HOEnZb"><br>
<br>
-- <br>
Loïc Hoguin<br>
<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br></span><div class="HOEnZb"><div class="h5">
______________________________<u></u>_________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/<u></u>listinfo/erlang-questions</a><br>
</div></div></blockquote></div><br></div>