September 2013
Intermediate to advanced
548 pages
12h 25m
English
A BIF is a built-in function; BIFs are functions that are defined as part of the Erlang language. Some BIFs are implemented in Erlang, but most are implemented as primitive operations in the Erlang virtual machine.
BIFs provide interfaces to the operating system or perform operations that are impossible or very inefficient to program in Erlang. For example, it’s impossible to turn a list into a tuple or to find the current time and date. To perform such an operation, we call a BIF.
For example, the BIF list_to_tuple/1 converts a list
to a tuple, and time/0 returns the current time of day in
hours, minutes, and seconds.
| | 1> list_to_tuple([12,cat,"hello"]). |
| | {12,cat,"hello"} |
| | 2> time(). |
| | {20,0,3} |
All BIFs behave as if they belong to ...
Read now
Unlock full access