[erlang-questions] separators before end

attila.rajmund.nohl@REDACTED attila.rajmund.nohl@REDACTED
Wed Sep 19 23:24:00 CEST 2007

On Wed, 19 Sep 2007, Minsloc Tarren wrote:

> But why would anybody want this ?
> If the meaning of the code doesn't change, the only thing is everybody would
> be forced to type extra characters (and it's the de-facto standard to use
> semicolon as separator or end-statement character, this would only confuse
> newcomers.

No need to force, just allow. For example let's say I have a case
statement like this:
case SomeVar of
 	1 -> do_something;
 	2 -> do_otherthing

Then I realize that I need to handle the value of 3 also, so I just add
a line:
case SomeVar of
 	1 -> do_something();
 	2 -> do_other thing()
 	3 -> do_some_other_thing()

and I get compilation error. Actually this is the most common
compilation error I receive. If erlang would allow syntax like this:
case SomeVar of
 	1 -> do_something;
 	2 -> do_otherthing;

I wouldn't get these error messages. It's _really_ annoying.

"Beware of bugs in the above code; I have only proved it correct, not
  tried it."

More information about the erlang-questions mailing list