Loup Vaillant wrote: >2008/1/28, Brian Hurt : > > >>I *hate* operator overloading. My experience in C++ is for every time >>this feature is used legitimately (i.e. to implement complex numbers or >>whatever), it's abused 10 times- and that's ignoring C++'s use of the >>bit shift operators << and >> for I/O, and the use of + for string >>concatentation, both of which I'd argue really should be considered >>abuses, as far as I'm concerned. And this is ignoring the difficulty of >>type inference in the presence of overloaded operators. >> >>The best way to handle this IMHO is Haskell-style type classes. Which >>solves the whole type inference problem, and rules most of what I >>consider abuses of operator overloading (for example, if you have a '+' >>operator, you also have to have a '*' operator- and what is "foo" * >>"bar"?). But this is a very non-trivial change to the language. >> >> > >Err, are you really suggesting type classes to be added in Ocaml? > > No. I was using that to try and kill the idea of operator overloading. Brian