开发者

What does "new" do when called on an erlang module do?

开发者 https://www.devze.com 2022-12-20 06:32 出处:网络
I\'ve seen module_name:new used in Erlang code, but there is no reference to a \"ne开发者_运维问答w\" function in the module_name module. What does \"new\" do?It is for \"parametrized module\": see he

I've seen module_name:new used in Erlang code, but there is no reference to a "ne开发者_运维问答w" function in the module_name module. What does "new" do?


It is for "parametrized module": see here and there for more details.


        'new'/2 =
    fun (_cor1,_cor0) ->
     apply 'instance'/2
         (_cor1, _cor0)
'instance'/2 =
    fun (_cor1,_cor0) ->
     {'p',_cor1,_cor0}  %%GOTCHA!!!!!

http://www.cnblogs.com/me-sa/archive/2012/02/16/Erlang0037.html

0

精彩评论

暂无评论...
验证码 换一张
取 消