Erlang – is_tuple

Erlang is_tuple

In this guide, we will discuss Erlang is_tuple. This method is used to determine is the term provided is indeed a tuple.

Syntax

is_tuple(tuple)

Parameters

  • Tuple − This is the tuple which needs to be verified to see if it really is a tuple.

Return Value

Returns true if indeed the inputed value is a tuple else it will return false.

For example

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

start() -> 
   P = {john,24,{june,25}} , 
   io:fwrite("~w",[is_tuple(P)]).

Output

The output of the above program is as follows −

true

Next Topic : Click Here

This Post Has One Comment

Leave a Reply