A funny analogy regarding real and complex numbers. If we're so OO, why don't we make integers a subclass of floats?
I guess the reasons are obvious. A subclass-superclass relationship isn't the same as subset-superset. Moreover, as Alex Stepanov (the designer of the STL) notes, even issues of function domain can't be handled by OO alone, we need generics.
no subject
Date: 2004-06-04 03:00 am (UTC)I guess the reasons are obvious. A subclass-superclass relationship isn't the same as subset-superset. Moreover, as Alex Stepanov (the designer of the STL) notes, even issues of function domain can't be handled by OO alone, we need generics.