æ¬æ¥ã®Erlang Lite #2ã®äºç¿ãªãã ãã©,ããç ããªã£ãã®ã§ããããã!! ãªã®ã§ä¸éå端ã«éä¸ã¾ã§w. Ex.3-1 %% ex1.erl -module(ex1). -compile(export_all). sum(1) -> 1; sum(N) -> N + sum(N-1). sum(N, M) -> if N == M -> N; N < M -> M + sum(N, M-1) end. Ex.3-2 %% ex2.erl -module(ex2). -compile(export_all). create(0) -> []; create(N) -> create(N-1) ++ [N]. reverse_create(0) -> []; reverse_create(N) -> [N|create(N-1)]. Ex.3-3 %% ex3.erl -module
{{#tags}}- {{label}}
{{/tags}}