2012-05-07 4 views
2

私はErlangのスクリプトをコンパイルしようとすると、私はこのエラーを取得しておいてください。Erlangの構文エラー

([email protected])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

+0

は、前の関数定義が '.'で正しく終了していますか? –

答えて

4

あなたがあります最後の最後の後にピリオドで関数を終了する必要があります。