As you know by now, Erlang is a functional programming language. In my point of view, different programming has different problem solving philosophy:
- Procedural: describe the steps needed to be taken to solve the problem.
- Logical (Declarative): describe the problem properly and let the language solve it.
- Object-orientation: design the objects that will lead you to the solution.
- Functional: define small and precise functions that all together solve the problem.
Declaring a Function
Syntax:
1 2 3 4 |
|
Example:
1 2 3 4 |
|