をコンパイルするとき、私は構文エラーの前に:「終了」コード
syntax error before: 'end'
を取得しています、私は割り当てのためにこのコードを実行するごとに単一の時間:
closest(_P, _PointList) ->
case (length(_PointList =:= 0)) of
true -> {0,0};
false -> closest(_P, tl(_PointList), distance(_P, hd(_PointList)), 1)
end.
% Llength = length(_P),
closest(P, _PointList, _Distance, _Index) ->
case (length(_PointList =:= 0)) of
true -> {_Index, _Distance};
false ->
New_Distance = min(_Distance, distance(_P, hd(_PointList)),
case (New_Distance < _Distance) of
true -> closest(_P, tl(_PointList), New_Distance, _Index + 1);
false -> closest(_P, tl(_PointList), _Distance, _Index)
end
end
end.
誰かが、これはなぜ私が把握助けることができますハプニング?おかげ