
9 Apr
2010
9 Apr
'10
4:41 p.m.
On 9 April 2010 12:34, Larry Evans <cppljevans@suddenlink.net> wrote:
I'm still not seeing it :( I thought algebraic data types were one thing OO programming did well. For example, a stack is an ADT and the stl library has a stack.
The problem there is that while the words are right, I don't know of any case where those two examples are implemented as the words imply. class stack : public ADT {}; What goes in the ADT base class that's useful? Similarly, the library isn't written like this: class stl_library { stack stack_; }; Since the usual OO version of "HAS-A" doesn't work for libraries and types.