Erlang - pid_to_list



It converts a process id to a list.

Syntax

Pid_to_list(processid)

Parameters

  • processid − This is the process id which needs to be converted to a list.

Return Value

Returns the list from the process id.

For example

-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)]).

Output

When we run the above program we will get the following result.

"<0.55.0>"
"hello" "process"
erlang_processes.htm
Advertisements