<div dir="ltr">2008/9/8 Edwin Fine <span dir="ltr"><<a href="mailto:erlang-questions_efine@usa.net">erlang-questions_efine@usa.net</a>></span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr">I had this exact issue last night, and this is something like what I did because I knew in advance what the arities would be (for better or worse, IANAEE):<br><br>mf_to_fun1(M, F) -><br>    fun(X) -> M:F(X) end.<br>

<br>mf_to_fun2(M, F) -><br>
    fun(X,Y) -> M:F(X,Y) end.<br>
<br>Ugly but it got the job done. It would be really nice if we could just use fun M:F/A, with all these being variables. Surely it can't be a big step beyond apply(M, F, [Args])?</div></blockquote><div><br>There is an undocumented BIF that can be called like this<br>
<br></div><div>erlang:make_fun(Mod, Name, Arity)<br><br>to create a fun.<br><br></div></div>/Bjorn<br><br>-- <br>Björn Gustavsson, Erlang/OTP, Ericsson AB<br>
</div>