这是erlang shell的输出:
1> atom.
atom
2> next_atom.
next_atom
3> atom@erlang.
atom@erlang
4> 'atom in single quotes'.
'atom in single quotes'
5> atom = 'atom'.
atom
6> a.tom.
'a.tom'
7> a..tom.
* 1: syntax error before: '..'
Run Code Online (Sandbox Code Playgroud)
当.原子中只有一个点(第6行)时,我没有错误.但是,当有..,我得到语法错误.是否..有一些二郎特殊的意义或为什么会出现错误时.能正常工作?
这是我的代码:
handle_cast(start, #state{started = false} = State) ->
gen_server:cast(self(), add_process),
{noreply, State#state{started = true}};
handle_cast(add_process, State) -> ...
Run Code Online (Sandbox Code Playgroud)
gen_server:castinsinde handle_cast函数可以打电话吗?我期望它做的是handle_cast返回一个新状态然后add_process立即处理消息.