[erlang-questions] OOP in Erlang

Richard O'Keefe <>
Thu Aug 12 05:29:38 CEST 2010


On Aug 12, 2010, at 12:08 AM, Attila Rajmund Nohl wrote:
> But it's nothing compared to the headache caused by the four different
> ways to end a "statement": comma, full stop, semicolon or nothing.

I'm a little puzzled by this.
Allowing expressions to be called statements,
Erlang doesn't have *ANY* way to "end" them.
(Of course every kind of opening bracket has a corresponding
closing bracket, but I'm not counting ")" as a way to end a
"statement".)

Erlang uses the full stop to terminate top level forms.
That is the ONLY way they can end.
They are the ONLY things so terminated.

Commas and semicolons are not terminators,
they are separators.

Semicolon is the "else" that someone recently said Erlang
didn't have.  Much confusion can be saved by putting
semicolons at the beginning of lines, making it clear
that ";" is no more of a statement terminator in Erlang
than "else" can be called a statement terminator in Pascal.



More information about the erlang-questions mailing list