【问题标题】:Erlang syntax errorErlang 语法错误
【发布时间】:2012-05-16 05:44:38
【问题描述】:

当我尝试编译我的 erlang 脚本时,我不断收到此错误:

(master@WN7-18TL6M1.amer.dell.com)15> c(distribute).
distribute.erl:55: syntax error before:
distribute.erl:42: function get_completed/3 undefined
error

这是我的来源:

get_completed(Current, Index, Count) ->
    if
        length(Current) >= Index ->
            {Count, length(Current)};
        true ->
            if 
                lists:nth(Index, Current) == 'timeout' ->
                    get_completed(Current, Index+1, Count);
                true ->
                    get_completed(Current, Index+1, Count+1)
            end
    end

第 55 行是最后一个 end

【问题讨论】:

  • 您之前的函数定义是否以 . 正确结束?

标签: erlang


【解决方案1】:

您需要在最后一个结束后用句点结束函数。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-08-23
    • 2014-03-19
    • 2015-01-27
    • 2015-09-13
    • 1970-01-01
    • 2011-04-06
    • 2014-06-08
    • 2015-02-24
    相关资源
    最近更新 更多