Can anyone translate this simple erlang code to retlang?

18 views
Skip to first unread message

IL

unread,
Mar 8, 2009, 1:37:10 AM3/8/09
to retlang-dev
run(0) -> 0;
run(1) -> 1;
run(N) ->
S = self(),
spawn(fun() -> f(S, N-1) end),
spawn(fun() -> f(S, N-2) end),
receive
M1 -> ok
end,
receive
M2 -> ok
end,
M1 + M2.

f(Pid, N) ->
Pid!run(N).
Reply all
Reply to author
Forward
0 new messages