erl_internal(3)

πŸ“¦
version 29.0.6 Β· 3 versions
, in ubuntu stonking

πŸŽ€ erl_internal πŸŽ€

okay bestie, welcome to the erl_internal page β€” this is from the Erlang Module Definition corner of the manual, and it's lowkey the vibes-only module you only meet if you're out here doing code gymnastics πŸ’…


🌸 NAME 🌸

erl_internal β€” internal Erlang definitions, periodt.


✨ DESCRIPTION ✨

So this module is where Erlang's BIFs, guard tests, and operators get their whole definition. That's the whole personality.

But listen: this module is only of interest to programmers who manipulate Erlang code. Like, if you're not out there messing with abstract forms and compiler internals, this is not your girl. No shade. It's just giving "you had to be there" energy. πŸ¦‹


πŸ’– FUNCTIONS πŸ’–

add_predefined_functions

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

This one takes your Forms and glow-ups them by adding in the code for the standard pre-defined functions (think things like module_info/0) that every module is supposed to carry around. Every module. No exceptions, bestie. 🫢

arith_op

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

Returns true if OpName/Arity is an arithmetic operator. Otherwise it's giving false. πŸ“

bif

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

Returns true if Name/Arity is an Erlang BIF that the compiler automatically recognizes β€” like, it just knows them, main character BIFs ✨ β€” otherwise false.

bool_op

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

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

comp_op

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

Returns true if OpName/Arity is a comparison operator, otherwise false. Yes queen, go off with your < and your = comparisons.

guard_bif

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

Returns true if Name/Arity is an Erlang BIF that's allowed to show up in guards β€” the VIP section of Erlang, only certain BIFs get in πŸ”₯ β€” otherwise false.

list_op

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

Returns true if OpName/Arity is a list operator, otherwise false. Love that for lists. πŸ’œ

op_type

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

This is the "what's your type" function, literally. It hands you back the Type of operator that OpName/Arity belongs to. The options are arith, bool, comp, list, or send.

⚠️ and if it's not an operator at all? It generates a function_clause error. So, like, do a vibe check before you call it, okay? πŸ’€

send_op

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

Returns true if OpName/Arity is a send operator, otherwise false. Sending messages AND sending receipts, honestly. πŸ’…

type_test

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

Returns true if Name/Arity is a valid Erlang type test, otherwise false. Last one, and she ate πŸŽ€


that's the whole page, bestie, you made it to the end 🧚 no cap 🫢

Ericsson AB Β· stdlib 8.0.4 β€” that's the source and version, and the page is erl_internal(3). mwah, take care of her πŸŒˆπŸ’–

πŸ“¦ where this page comes from