Erlang – self

Erlang self

In this guide, we will discuss Erlang Self. One of the most commonly used BIF, returns the pid of the calling processes.

Syntax

self()

Parameters

None

Return Value

Returns the pid of the calling processes.

For example

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

start() -> 
   io:fwrite("~p~n",[self()]).

Output

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

<0.2.0>

Next Topic : Click Here

This Post Has 2 Comments

Leave a Reply