Various (and almost completely unrelated) questions and opini ons
Wed Feb 21 17:40:42 CET 2001
> Have you looked at Oberon? I am somewhat persuaded by the
> Oberon rationale
> against overloaded operators. Oberon is roughly my idea of
> what a C level
> language with objects should have been. They claim extreme
> simplicity is
> a good thing. To back it up, the Oberon language
> specification is coherent
> and complete in something like 28 pages. See other simple
> languages, eg
> R5RS for contrast.
Overloaded operators don't make sense in a functional language, IMO.
Actually, I'd argue that they don't make sense in C++. If you consider
matrix multiplication, the old style C way was like this: matmul(result, a,
b). The pain isn't from having to type "matmul" instead of "*", it's from
having to keep track of temporary variables to hold intermediate results.
This could be rewritten to use returned structures instead: result =
matmul(a, b). That takes care of most of the problem.
In functional languages the "structure return" style is the norm, so I don't
see a need for overloaded operators. In fact, I'd be just fine with having
to type add(X,Y) everywhere instead of A+Y, as long as there were versions
of add that supported different numbers of parameters. Maybe I'm just weird
More information about the erlang-questions