[erlang-questions] anyway to make recursion inside anonymous funs?

VAUCHER Laurent <>
Wed Mar 28 18:03:10 CEST 2007


http://en.wikipedia.org/wiki/Anonymous_recursion  ?


-----Message d'origine-----
De :  [mailto:] De la part de June Kim
Envoyé : 28 March 2007 17:45
À : 
Objet : [erlang-questions] anyway to make recursion inside anonymous funs?

"fun" expressions can be used to declare a function. Can it make a recursive call inside?

That is,

Can I somehow declare the following with callself, which is an imaginary functionality that calls the anonymous function itself?

fun(X) -> receive {P,V} -> P!(X+V), callself(X+V) end end.
_______________________________________________
erlang-questions mailing list

http://www.erlang.org/mailman/listinfo/erlang-questions






More information about the erlang-questions mailing list