[erlang-questions] Orthogonality and Principle of least surprise Was: chained functions

Jakob Praher <>
Wed Feb 1 11:11:28 CET 2012


Jup, I have read that the binary tuple construct is deprecated.

I am just wondering what the benefits of using "fun module:fun/0" are. It is also just a designator (a reference) and has to be evaluated at runtime to get the address of the current function loaded. I can think that "fun module:fun/0" is used to be more familiar with anonymous functions.

According to parse_erl.yrl atom:atom is an expression (matched by expr_800), right?

expr_800 mathces "expr_900 ':' expr_max" and 
expr_900 matches "expr_max"
expr_max matches "atomic"
atomic matches "atom"


function_call -> expr_800 argument_list :
{call,?line('$1'),'$1',element(1, '$2')}.

Best,
Jakob

Am Mittwoch, 01. Februar 2012 10:17 CET, Attila Rajmund Nohl <> schrieb: 
 
> 2012/2/1, Jakob Praher <>:
> >
> > Thanks for your reply.
> >
> > As a counterargument F = {module,fun}, F(). works.
> 
> Currently. As far as I know, it is planned to not work in OTP R16B.
> Even OTP R15B produces run-time warnings for this construct.
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
 
 
 
 




More information about the erlang-questions mailing list