[erlang-questions] Erlang Syntax - again
Ulf Wiger (TN/EAB)
Tue Mar 11 10:52:23 CET 2008
Richard A. O'Keefe skrev:
> Currently I write
> case myfun(abc)
> of zot -> bar
> ; zing -> baz
> and it seems to work out OK.
> Ada of course uses 'when' the way I'm using ';', and it's not optional.
> Why do I want to put the ';' at the beginning of a line?
> Because patterns in Erlang designedly look a whole lot like expressions,
> and I want it to be *obvious* to the reader, especially me, that
> "here is a pattern".
And for those who continuously have problems with the different
trailing deliminators, this could pretty much solve the problem.
Of course, using Emacs, one would have to turn off the "electric
semicolon" feature, which often gets it wrong, anyway. The
auto-indentation of the emacs mode also butchers this style of
writing. So any emacs user who hasn't dug into the .emacs file
changing the defaults, would most likely go bezerk if they had
to edit a program written in this style - that - or turn off the
emacs erlang-mode completely.
(Not saying this couldn't be fixed. I also find the style visually
More information about the erlang-questions