我的 erlang 代码没有按预期打印
My erlang code not printing as expected
**
-module(shubham).
-export([call/0, hi/0, guy/0]).
call() -> hi().
hi() -> guy();
hi() -> io: fwrite("This is hi \n").
guy() -> io:fwrite("This is A guy\n").**
它应该打印 "This is A guy" 然后“This is hi”但只打印 guy()
您应该在第四行之后使用 ,
而不是 ;
并删除 hi() ->
如下所示:
-module(shubham).
-export([call/0, hi/0, guy/0]).
call() -> hi().
hi() -> guy(),
io:fwrite("This is hi \n").
guy() -> io:fwrite("This is A guy\n").
**
-module(shubham).
-export([call/0, hi/0, guy/0]).
call() -> hi().
hi() -> guy();
hi() -> io: fwrite("This is hi \n").
guy() -> io:fwrite("This is A guy\n").**
它应该打印 "This is A guy" 然后“This is hi”但只打印 guy()
您应该在第四行之后使用 ,
而不是 ;
并删除 hi() ->
如下所示:
-module(shubham).
-export([call/0, hi/0, guy/0]).
call() -> hi().
hi() -> guy(),
io:fwrite("This is hi \n").
guy() -> io:fwrite("This is A guy\n").