Erlang – put

Erlang put

In this guide, we will discuss Erlang Put. This method is used to put a key, value pair in the process dictionary.

Syntax

put(key,value)

Parameters

  • key − The key which needs to be added to the process dictionary.
  • value − The value which needs to be added to the process dictionary.

Return Value

None

For example

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

start() -> 
   put(1,"One"), 
   put(2,"Two"), 
   io:fwrite("~p~n",[get()]).

Output

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

[{2,"Two"},{1,"One"}]

Next Topic : Click Here

This Post Has 2 Comments

Leave a Reply