Paste number 61520: Ninjas

Index of paste annotations: 1 | 2

Paste number 61520: Ninjas
Pasted by: nem
6 months, 1 day ago
None
Paste contents:
Raw Source | XML | Display As
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 1: fixed a bit
Pasted by: nem
6 months, 1 day ago
Paste contents:
Raw Source | Display As
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
)
.

Annotation number 2: more fixed
Pasted by: nem
6 months, 1 day ago
Paste contents:
Raw Source | Display As
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
)
.

Colorize as:
Show Line Numbers
Index of paste annotations: 1 | 2

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.