Archive for March 14, 2011
Introduction to Erlang : Modules & Compilation
Modules
A module is a container for functions; it provided the contained functions with a common namespace. Modules are used to organize functions in Erlang. Usually, a program in Erlang spans over more than one modules. You can imagine a module as a package in Java, or a header file in C.
Calling a Function
The calling convention in Erlang is module:function(argument1, argument2, ...)
. For example:
1> lists:max([1,3,2]). 3 |
Defining Modules
Lets say we want to create a module that will contain our own implementation of list functions and name it mlists
.
Read the rest of this entry »