问题
I've seen module_name:new used in Erlang code, but there is no reference to a "new" function in the module_name module. What does "new" do?
回答1:
It is for "parametrized module": see here and there for more details.
回答2:
'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
来源:https://stackoverflow.com/questions/2283480/what-does-new-do-when-called-on-an-erlang-module-do