小编jur*_*uro的帖子

二郎原子和"......"

这是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行)时,我没有错误.但是,当有..,我得到语法错误.是否..有一些二郎特殊的意义或为什么会出现错误时.能正常工作?

erlang

5
推荐指数
1
解决办法
1004
查看次数

调用gen_server:从Mod:handle_cast转换

这是我的代码:

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立即处理消息.

erlang erlang-otp

4
推荐指数
1
解决办法
568
查看次数

标签 统计

erlang ×2

erlang-otp ×1