Page 1 of 1
Language Question
Posted: Tue Nov 01, 2005 9:49 pm
by Crazed123
Here's a language question: is there any language that has a dynamic data-types feature where you can overload operators (including =) without having to refer to the data as an object?
Re:Language Question
Posted: Thu Nov 03, 2005 2:35 am
by Schol-R-LEA
SML, Miranda, Algol-68 and the original Ada. Haskell, too, I think, but I'd have to check.
I'd mention Common Lisp but it doesn't really have a concept of 'operators' in the usual infix sense, and while you can override functions, you can't actually overload them IIRC.
If you don't mind me inquiring, why do you ask?
Most language designers today consider operator overloading a Bad Thing, really. While it gains some leverage as syntactic sugar, it has considerable potential for confusion, much more so than overloaded functions.
Re:Language Question
Posted: Fri Nov 04, 2005 2:26 pm
by Crazed123
Because it seems to me to make a lot of sense to be able to say "this is how you treat blah". Just interested.
Re:Language Question
Posted: Sun Nov 06, 2005 8:51 am
by Candy
Schol-R-LEA wrote:
SML, Miranda, Algol-68 and the original Ada. Haskell, too, I think, but I'd have to check.
I can confirm Haskell, although I dislike the syntax to do so.