[erlang-questions] How to wrap a function of any arity

Vlad Dumitrescu <>
Fri Nov 17 23:30:27 CET 2006


Hi,

On 11/17/06, Gaspar Chilingarov <> wrote:
> you can test function arity and wrap it in a different ways.
> 2> F = fun(X) -> ok end.
> #Fun<erl_eval.6.56006484>
> 3> is_function(F).
> true
> 4> is_function(F, 1).
> true
> 5> is_function(F, 2).
> false

Or one can wrap all arguments in a list and use apply(Fun, Args)
instead of Fun(Args).

best regards,
Vlad



More information about the erlang-questions mailing list