9.3 Predefined Macros

The following macros are predefined:

  • ?MODULE
  • The name of the current module.
  • ?MODULE_STRING.
  • The name of the current module, as a string.
  • ?FILE.
  • The file name of the current module.
  • ?LINE.
  • The current line number.
  • ?MACHINE.
  • The machine name, 'BEAM'.
  • ?FUNCTION_NAME
  • The name of the current function.
  • ?FUNCTION_ARITY
  • The arity (number of arguments) for the current function.
  • ?OTP_RELEASE
  • The OTP release that the currently executing ERTS application is part of, as an integer. For details, see erlang:system_info(otp_release). This macro was introduced in OTP release 21.