Funs names in Erlang 17 -
Erlang 17 was released. And according to this:
Fun now can be named
No examples given.
Any idea how to assign a name to fun in 17?
Which Armstrong explains about it with an example
1 & gt; F = Funny F (0) - & gt; 1; F (n) - & gt; N * F (N-1) End # Fun
You must first pass an anonymous recursive call to the function as an ARG (think of Y-coordinator).
1> F = Funny (F, 0) - & gt; 1; (F, N) - & gt; N * F (F, N-1) End # Fun
Comments
Post a Comment