[erlang-questions] reference a fun from its atom name

Michael Uvarov <>
Sun Jun 17 19:20:14 CEST 2012


Use fun M:F/A, where M is a module name, F is a function name and A is arity.
M and F are atoms, A is non_neg_integer,


17> A = 1.
1
18> X = fun lists:reverse/A.
#Fun<lists.reverse.1>
19> X([1,2,3]).
[3,2,1]



More information about the erlang-questions mailing list