In this guide, we will discuss Erlang is_atom. This method is used to determine if a term is indeed an atom.
Syntax
is_atom(term)
Parameters
- term − This is the term value which needs to be evaluated as to whether it is an atom or not.
Return Value
True, if the term value is an atom or else false will be returned.
For example
-module(helloworld). -export([start/0]). start() -> io:fwrite(atom1), io:fwrite("~n"), io:fwrite("~p~n",[is_atom(atom1)]).
Output
The output of the above program is as follows.
atom1 true
Next Topic : Click Here
Pingback: Erlang - Atoms | Adglob Infosystem Pvt Ltd