我正在youtube的视频中学习erlang的基础知识。我被困在一个视频教程中。这是代码:
say_something(_,0) ->
io:format("Done ~n");
say_something(Value, Times) ->
io:format("~s ~n", [Value]),
say_something(Value, Times-1).
start_concurrency(Value1, Value2) ->
spawn(easy, say_something, [Value1, 3]),
spawn(easy, say_something, [Value2, 3]).
say_something
功能正常:
(ErlangProject@Carl-PC)3> easy:say_something("Hello world", 3).
Hello world
Hello world
Hello world
Done
ok
但是,当我运行start_concurrency
时,我不知道会发生什么,但是我没有得到我应该得到的东西,就像在这里:
(ErlangProject@Carl-PC)4> easy:start_concurrency("Hello world", "Really Really").
easy:start_concurrency("Dynamically", "ee").
easy:start_concurrency("dfd", "dfd").
它不返回任何东西。我可以直接输入。我究竟做错了什么?请帮帮我。
谢谢!