link2.erl

link2.erl — Erlang source code, 227 bytes

Continguts del fitxer

-module(link2).
-export([cadena/1]).
�
cadena(0) ->
	receive
		_ -> ok
	after 2000 ->
		exit('Aqu� mor la cadena')
	end;

cadena(N) ->
	Pid = spawn(fun() -> cadena(N-1) end),
	link(Pid),
	receive
		_ -> ok
end.