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

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -