| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Storing data and code in a Db with LISP-like interface
Dmitry A. Kazakov wrote:
> I am free to consider integers a subtype of rationals regardless their
> construction (=representation.) Important here is only that integer
> inherits +, -, * which I wish to reuse as well as the programs written for
> rationals in terms of these operations.
How does integer "inherits" arithmetic operations? You need a covariant return type:
+(rational, rational) returns rational
+(integer, integer) returns integer
But then, you have to redefine arithmetic operations for integers anyway. So what is the point of inheritance, then? Received on Fri May 05 2006 - 17:34:48 CDT
![]() |
![]() |