<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])?<br><br><div class="gmail_quote">On Mon, Sep 8, 2008 at 12:59 AM, Richard A. O'Keefe <span dir="ltr"><<a href="mailto:ok@cs.otago.ac.nz">ok@cs.otago.ac.nz</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">On 5 Sep 2008, at 10:45 pm, Richard Carlsson wrote:<br>
> There is currently no immediate way of doing this.<br>
<br>
</div>We have the "fun <name>/<arity>" notation, which I believe<br>
has been extended or will be extended to "fun <module>:<name>/<arity>".<br>
It would seem like a minor change to the language to allow<br>
variables here.<br>
<br>
It must be said, this looks like a case for the<br>
old-fashioned {M,F} or {M,F,A} tuples-naming-functions.<br>
<div><div></div><div class="Wj3C7c"><br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://www.erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://www.erlang.org/mailman/listinfo/erlang-questions</a><br>
<br>
</div></div></blockquote></div><br></div>