erl_internal — stdlib v6.0.1

Search documentation of stdlib

# View Source erl_internal (stdlib v6.0.1)

Internal Erlang definitions.

This module defines Erlang BIFs, guard tests, and operators. This module is only of interest to programmers who manipulate Erlang code.

# Summary

## Functions

add_predefined_functions(Forms)

Adds to `Forms` the code for the standard pre-defined functions (such as `module_info/0`) that are to be included in every module.

arith_op(OpName, Arity)

Returns `true` if `OpName/Arity` is an arithmetic operator, otherwise `false`.

bif(Name, Arity)

Returns `true` if `Name/Arity` is an Erlang BIF that is automatically recognized by the compiler, otherwise `false`.

bool_op(OpName, Arity)

Returns `true` if `OpName/Arity` is a Boolean operator, otherwise `false`.

comp_op(OpName, Arity)

Returns `true` if `OpName/Arity` is a comparison operator, otherwise `false`.

guard_bif(Name, Arity)

Returns `true` if `Name/Arity` is an Erlang BIF that is allowed in guards, otherwise `false`.

list_op(OpName, Arity)

Returns `true` if `OpName/Arity` is a list operator, otherwise `false`.

op_type(OpName, Arity)

Returns the `Type` of operator that `OpName/Arity` belongs to, or generates a `function_clause` error if it is not an operator.

send_op(OpName, Arity)

Returns `true` if `OpName/Arity` is a send operator, otherwise `false`.

type_test(Name, Arity)

Returns `true` if `Name/Arity` is a valid Erlang type test, otherwise `false`.

# Functions

Link to this function

# add_predefined_functions(Forms)

View Source (since OTP 20.0)

    -spec add_predefined_functions(Forms) -> UpdatedForms
                                      when
                                          Forms :: [erl_parse:abstract_form() | erl_parse:form_info()],
                                          UpdatedForms ::
                                              [erl_parse:abstract_form() | erl_parse:form_info()].

Adds to `Forms` the code for the standard pre-defined functions (such as `module_info/0`) that are to be included in every module.

Link to this function

# arith_op(OpName, Arity)

View Source

    -spec arith_op(OpName, Arity) -> boolean() when OpName :: atom(), Arity :: arity().

Returns `true` if `OpName/Arity` is an arithmetic operator, otherwise `false`.

Link to this function

# bif(Name, Arity)

View Source

    -spec bif(Name, Arity) -> boolean() when Name :: atom(), Arity :: arity().

Returns `true` if `Name/Arity` is an Erlang BIF that is automatically recognized by the compiler, otherwise `false`.

Link to this function

# bool_op(OpName, Arity)

View Source

    -spec bool_op(OpName, Arity) -> boolean() when OpName :: atom(), Arity :: arity().

Returns `true` if `OpName/Arity` is a Boolean operator, otherwise `false`.

Link to this function

# comp_op(OpName, Arity)

View Source

    -spec comp_op(OpName, Arity) -> boolean() when OpName :: atom(), Arity :: arity().

Returns `true` if `OpName/Arity` is a comparison operator, otherwise `false`.

Link to this function

# guard_bif(Name, Arity)

View Source

    -spec guard_bif(Name, Arity) -> boolean() when Name :: atom(), Arity :: arity().

Returns `true` if `Name/Arity` is an Erlang BIF that is allowed in guards, otherwise `false`.

Link to this function

# list_op(OpName, Arity)

View Source

    -spec list_op(OpName, Arity) -> boolean() when OpName :: atom(), Arity :: arity().

Returns `true` if `OpName/Arity` is a list operator, otherwise `false`.

Link to this function

# op_type(OpName, Arity)

View Source

    -spec op_type(OpName, Arity) -> Type
                     when OpName :: atom(), Arity :: arity(), Type :: arith | bool | comp | list | send.

Returns the `Type` of operator that `OpName/Arity` belongs to, or generates a `function_clause` error if it is not an operator.

Link to this function

# send_op(OpName, Arity)

View Source

    -spec send_op(OpName, Arity) -> boolean() when OpName :: atom(), Arity :: arity().

Returns `true` if `OpName/Arity` is a send operator, otherwise `false`.

Link to this function

# type_test(Name, Arity)

View Source

    -spec type_test(Name, Arity) -> boolean() when Name :: atom(), Arity :: arity().

Returns `true` if `Name/Arity` is a valid Erlang type test, otherwise `false`.