AnatomyOf

Anatomy of an Erlang file

example.erl
1%% A minimal module. No semicolons were harmed... much.
2-module(greeter).
3-export([hello/1]).
4
5%% Clause for an enthusiastic greeting
6hello(Name) when is_list(Name) ->
7 io:format("Hello, ~s! Still no null pointer exceptions here.~n", [Name]);
8%% Clause for when someone hands us garbage
9hello(_) ->
10 io:format("Hello, stranger.~n").
Erlang is a functional, concurrent programming language designed for building scalable and fault-tolerant systems, running on the BEAM VM.