<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Jan 21, 2013 at 7:04 PM, 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">My proposal is to use an attribute to list the functions defined like this, so that error_handler can make the distinction between undef and badarg directly. The above function would then be written like this:<br>

<br>
$handle_undefined_function(<u></u>monitor, [process, Pid]) -><br>
    do_something();<br>
$handle_undefined_function(<u></u>demonitor, Pid) -><br>
    do_something_else().<br>
<br></blockquote><div><br></div><div style>I don't really get the rationale for your proposal.</div><div style><br></div><div style>If have understood you correctly, I must know beforehand</div><div style>which functions that $handle_undefined_function would handle,</div>
<div style>and put all functions to be handled in an attribute.</div><div style><br></div><div style>Why not use the existing -export() attribute and write like<br></div><div style>this:</div><div style><br></div><div style>
-export([monitor/2,demonitor/1]).</div><div style><br></div><div style>monitor(process, Pid) -></div><div style>   do_something.</div><div style><br></div><div style>demonitor(Pid) -></div><div style>   do_something_else().   </div>
<div><br></div><div style>So what would be the advantage of your version?</div><div style><br></div></div>-- <br>Björn Gustavsson, Erlang/OTP, Ericsson AB
</div></div>