6 ms·
English has no problems saying that a circle is an ellipse, though. Neither does math. I'd like my programming languages to be able to express math.
by cousin_it 16y ago
English has no problems saying that a circle is an ellipse, though. Neither does math. I'd like my programming languages to be able to express math.
- KirinDave 16y ago"is like" is not in the vocabulary in many OO languages, and that's the rub. A circle is not (in a general, behavioral sense) an elipse and can't support all the operations an ellipse is expected to do. As for asking for expressing math, things like CL's generic methods or Haskell's typeclasses model this sort of ad hoc series of relationships much more elegantly, in my opinion.
- cousin_it 16y agoHaskell's typeclasses are still a few hacks away from perfection :-) See the last part of this document: http://www.haskell.org/tutorial/numbers.html http://www.haskell.org/tutorial/numbers.html
- ataggart 16y agoThe rub comes when one tries to hang behaviour on the types.