Sim*_*mon 3 erlang functional-programming function-call
当我们意识到这是问题时,我和我的朋友试图在我们的代码中找到一个错误.
random_function(spawn_link(fun() -> worker(List, self(), Death) end));
Run Code Online (Sandbox Code Playgroud)
这是解决方案:
PID = self(),
random_function(spawn_link(fun() -> worker(List, PID, Death) end));
Run Code Online (Sandbox Code Playgroud)
所以我的问题是,为什么不能直接调用self()函数呢?是因为它是一个匿名函数还是某种特殊的Erlang?
归档时间: |
|
查看次数: |
336 次 |
最近记录: |