---
title: "Explain the predefined Macros in Erlang?"  
description: "Explain the predefined Macros in Erlang?"  
author: "Sunil Singh"  
published: 2017-01-13  
updated: 2020-09-23  
canonical: https://www.mindstick.com/interview/23186/explain-the-predefined-macros-in-erlang  
category: "erlang"  
tags: ["erlang"]  
reading_time: 1 minute  

---

# Explain the predefined Macros in Erlang?

## The following macros are predefined-

?MODULE : Return the name of the current module.

?MODULE_STRING. :Return the name of the current module as string.

?FILE: Give file name of the current module.

?LINE: Return the current line number.

?MACHINE: Give the machine name ,'BEAM'.

?FUNCTION_NAME : return name of the current function .

?FUNCTION_ARITY : return number of argument of the current function.

## Answers

### Answer by Sunil Singh

## The following macros are predefined-

?MODULE : Return the name of the current module.

?MODULE_STRING. :Return the name of the current module as string.

?FILE: Give file name of the current module.

?LINE: Return the current line number.

?MACHINE: Give the machine name ,'BEAM'.

?FUNCTION_NAME : return name of the current function .

?FUNCTION_ARITY : return number of argument of the current function.


---

Original Source: https://www.mindstick.com/interview/23186/explain-the-predefined-macros-in-erlang

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
