This module provides functions for creating and manipulating Erlang terms.
An Erlang term is represented by a C structure of type
Each of the following macros takes a single
The following macros can be used for retrieving parts of Erlang
terms. None of these do any type checking. Results are undefined
if you pass an
Concatenates two Erlang terms, prepending
The function returns a new list.
Example:
Creates and returns a copy of the Erlang term
Extracts a specified element from an Erlang tuple.
Returns a new Erlang term corresponding to the requested element, or
Extracts the first element from a list.
Returns an Erlang term corresponding to the head
head element in the list, or a
This function must be called before any of the others in the
Returns the length of an I/O list.
Returns the length of
For the definition of an I/O list, see
Converts an I/O list to a binary term.
Returns an Erlang binary term, or
Informally, an I/O list is a deep list of characters and binaries that can be sent to an Erlang port. In BNF, an I/O list is formally defined as follows:
Converts an I/O list to a
Returns a pointer to a dynamically allocated
buffer containing a string. If
For the definition of an I/O list, see
Determines the length of a proper list.
Returns
Creates an atom.
Returns an Erlang term containing an atom. Notice that it is
the caller's responsibility to ensure that
The UTF-8 variants were introduced in Erlang/OTP R16 and the
string returned by
Produces an Erlang binary object from a buffer containing a sequence of bytes.
Returns an Erlang binary object.
Creates and returns an empty Erlang list.
Notice that
Creates a list from a sequence of bytes.
Returns an Erlang list object corresponding to
the character sequence in
Creates an Erlang float.
Returns an Erlang float object with the value
specified in
Creates an Erlang integer.
Returns an Erlang integer object with the
value specified in
Creates an Erlang list from an array of Erlang terms, such that each element in the list corresponds to one element in the array.
The function creates an Erlang list object, whose length
Creates an Erlang reference, with 82 bits.
Notice that
Returns an Erlang reference object.
Creates an Erlang process identifier (pid). The resulting pid can be used by Erlang processes wishing to communicate with the C-node.
Returns an Erlang pid object.
Creates an Erlang port identifier.
Returns an Erlang port object.
Creates an old Erlang reference, with
only 18 bits - use
Notice that
Returns an Erlang reference object.
Creates a list from a
Returns an Erlang list.
Creates an Erlang tuple from an array of Erlang terms.
The function creates an Erlang tuple, whose arity is
To retrieve the size of a tuple, either use function
Creates an Erlang unsigned integer.
Returns an Erlang unsigned integer object with
the value specified in
Creates an unbound Erlang variable. The variable can later be bound through pattern matching or assignment.
Returns an Erlang variable object with the
name
Prints the specified Erlang term to the specified output stream.
Returns the number of characters written on success, otherwise a negative value.
By default, the
A call to
If this function is called, it may only be called once
directly after the call to function
You may run into trouble if this feature is used carelessly. Always ensure that all communicating components are either from the same Erlang/OTP release, or from release X and release Y where all components from release Y are in compatibility mode of release X.
Returns either the arity of an Erlang tuple or the number of bytes in an Erlang binary object.
Returns the size of
Extracts the tail from a list.
Returns an Erlang list corresponding to the
original list minus the first element, or
Returns the contents of the specified variable in an Erlang term.
Returns the Erlang object corresponding to the value of