[erlang-questions] erlang sucks
Richard A. O'Keefe
Tue Mar 11 02:14:14 CET 2008
My take on the separators issue:
(1) I'm used to the Prolog approach, where every clause ends with a
I'm also used to SML and Haskell and Clean, where again every
the same way (with nothing). If Prolog and Haskell can figure
adjacent clauses defining the same thing belong to the same
isn't clear to me why Erlang can't. I once wrote a functional
for Prolog where I could write
append(, Ys) = Ys.
append([X|Xs], Ys) = [X | append(Xs, Ys)].
and the use of a dot at the end of every function clause was no
all. Nor is it any trouble in Mercury.
I generally don't accept arguments about re-ordering definition
because if you know what you are doing it is pretty rare. But I
accept arguments about *adding* clauses when you revise a data
I wish that Erlang would allow all function clauses to end with a
(2) Again, I generally don't accept arguments about re-ordering function
calls in a body. I don't find that to be a common mistake. Oh,
make mistakes in Erlang. I make mistakes all the time in all
languages. One mistake I do make in Erlang and in C is to get
of arguments wrong. So why isn't Mr "Erlang sucks" complaining
about how C and Java use different terminators after the last
and all the others ",", making it hard to swap arguments?
isn't complaining about that BECAUSE C and Java do the same
thing, so he
hasn't noticed it.
(3) For what it's worth, my text editor, modelled on Emacs, but
small enough to fit comfortably on a PDP-11, has a "swap terms"
that interchanges the closed terms on either side of the cursor.
with the cursor where the ^ is, Ctrl-X t will convert this to
with no trouble at all. More generally, the DEdit editor in
had a nice facility: you could build up a stack of selections
choose an operation, so you could
select thing one (except for its terminator)
select thing two (except for its terminator)
swap top selections
Gosh, I miss the ability to have multiple selections.
So this is arguably an EDITOR problem, not a LANGUAGE problem,
can be addressed by more/better editor support. (Is there an XCode
plugin for Erlang?)
More information about the erlang-questions