Add tags

Add tags to the following comment

Erlang のプレーンな例は、他の方が解答されていましたので、あえて lists ライブラリを積極的に使ったパターンを投稿してみます。 ミソは、終了メッセージの選択受信かな?

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
-module(doukaku215).
-author('cooldaemon@gmail.com').
-export([run/0]).

run() ->
  Pid = self(),
  lists:foreach(
    fun (CPid) -> receive {CPid, finish} -> ok end end,
    lists:map(
      fun (Cs) -> spawn(fun () ->
        lists:foreach(fun (C) -> io:fwrite("~s", [[C]]) end, Cs),
        Pid ! {self(), finish}
      end) end,
      lists:map(fun (N) -> lists:seq(N, N+8) end, [$1, $A])
    )
  ).

Add tags

The input will be splited to tags with space.

Index

Feed

Other

Link

Pathtraq

loading...