Erlang - pid_to_list



它將程序 ID 轉換為列表。

語法

Pid_to_list(processid)

引數

  • processid − 這是需要轉換為列表的程序 ID。

返回值

返回程序 ID 生成的列表。

例如

-module(helloworld). 
-export([start/0, call/2]). 

call(Arg1, Arg2) ->
   io:format("~p ~p~n", [Arg1, Arg2]). 

start() ->
   Pid = spawn(?MODULE, call, ["hello", "process"]), 
   io:fwrite("~p~n",[pid_to_list(Pid)]).

輸出

當我們執行上述程式時,我們將獲得以下結果。

"<0.55.0>"
"hello" "process"
erlang_processes.htm
廣告

© . All rights reserved.