Archive for April 13, 2011
Introduction to Erlang : BIFs & Predefined Modules
Built-in Functions (BIFs)
Erlang’s Built-in Functions (shorthand BIFs) are commonly used functions that are intergrated into the Erlang’s VM for performance reasons. Most of them belong to the erlang
module, but there are some in other modules, such as lists
.
The BIFs can be separated to standard and non-standard. The standard ones are auto-imported; they can be called without the use of the module name prefix (remember the effect of the -import(...)
directive). On the other hand, the non-standard ones have to be called following the normal module:function(...)
convension. In the erlang
module’s man pages (here) the distinction between standard and non-standard is visible by the lack or existence of the erlang
(module’s name) prefix.
elrang
abs/1
Arithmetic absolut value of an integer or float.
erlang:append_element/2
Appends an element to a tuple.
apply/2|3
Calls the function passed as a parameter.
atom_to_list/1
Returns a string which corresponds to the text representation of Atom.
Read the rest of this entry »