Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article?

I've got to the stage where I've written quite a bit of Erlang code now, and I can see some style (bad or good) creeping into the way I've been writing it. This particular idiom I'd like some opinion on - is it better (more readable/faster/whatever) to convert case style statements to function pattern matching? E.g. Compare (a contrived example) case {Size > 100000, Type} of {true, ets } -> %% Do
defmodule Linear do def list?([]), do: true def list?([_|t]), do: list?(t) def list?(_), do: false def foldl([], acc, _fun), do: acc def foldl([h|t], acc, fun), do: foldl(t, fun.(h, acc), fun) def foldr([], acc, _fun), do: acc def foldr([h|t], acc, fun), do: fun.(h, foldr(t, acc, fun)) # 一般的な言語では、 # 以下に示す関数群は左畳み込みで実装されていると思います。 def reverse(list) when is_list(list) do foldl(list, [], fn x, acc -> [
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く