Scala

Pages: 12
Shenanigans :D
closed account (EzwRko23)
Separate from that, operators don't add functionality to a language; they exist merely for notational convenience.


Thanks, jsmith. Someone told it at last. Judging language expressivity on the ability to overload/add operators is one of the most stupidest idea I have ever heard of. It is like discussing such things like meaningful whitespace in Python or parentheses in LISP.

However, it is interesting to analyse, how some languages deal with operator overloading. C++ does that with special language construct. User-defined operators are a different thing than built-in ones (the built-in operators are *not* functions or methods like the overloaded ones). This complicates language and makes "operator overloading" an obligatory section in any C++ book.

On the contrary, Haskell, Scala and Ruby technically don't have operators at all. All the operators ARE just methods. Therefore, these languages have less internal complexity but give you more (ability to create new operators easily is just a side-effect).
Last edited on
C++ FQA Lite says:
The idea to overload "bitwise exclusive or" to mean "power" is just stupid. I wonder where they get these ideas. It's as if someone decided to overload "bitwise left shift" to mean "print to file". Wait a minute - they did that, too... Oh well.

http://yosefk.com/c++fqa/operator.html#fqa-13.7

Oops... I think I just gave xorebxebx more ammo... xD
closed account (EzwRko23)
Thanks, m4ster r0shi.
Nice link. Added to favourites. :) :) :)
Last edited on
Topic archived. No new replies allowed.
Pages: 12