| Paste number 61520: | Ninjas |
| Pasted by: | nem |
| When: | 1 year, 1 month ago |
| Share: | Tweet this! | http://paste.lisp.org/+1BGW |
| Channel: | None |
| Paste contents: |
RLoop = fun (F) ->
receive
hello -> io:format("Got anonymous hello world.~n", []);
{hello_from, Sender, please_greet, Who} -> Sender ! "Hello " ++ term_to_list(Who);
stop -> exit(bye)
end,
F(F)
end.
Greeter = spawn(fun () ->
RLoop(RLoop)
end).Annotations for this paste:
| Annotation number 2: | more fixed |
| Pasted by: | nem |
| When: | 1 year, 1 month ago |
| Share: | Tweet this! | http://paste.lisp.org/+1BGW#2 |
| Paste contents: |
RLoop = fun (F) ->
receive
hello -> io:format("Got anonymous hello world.~n", []);
{hello_from, Sender, please_greet, Who} when is_list(Who) ->
Sender ! lists:flatten(io_lib:format("Hello ~s", [Who]));
{hello_from, Sender, please_greet, Who}h ->
Sender ! lists:flatten(io_lib:format("Hello ~p", [Who]));
stop -> exit(bye)
end,
F(F)
end.
Greeter = spawn(fun () ->
RLoop(RLoop)
end).| Annotation number 1: | fixed a bit |
| Pasted by: | nem |
| When: | 1 year, 1 month ago |
| Share: | Tweet this! | http://paste.lisp.org/+1BGW#1 |
| Paste contents: |
RLoop = fun (F) ->
receive
hello -> io:format("Got anonymous hello world.~n", []);
{hello_from, Sender, please_greet, Who} -> Sender ! lists:flatten(io_lib:format("Hello ~p", [Who]));
stop -> exit(bye)
end,
F(F)
end.
Greeter = spawn(fun () ->
RLoop(RLoop)
end).