Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> Re: Storing data and code in a Db with LISP-like interface

Re: Storing data and code in a Db with LISP-like interface

From: Mikito Harakiri <mikharakiri_nospaum_at_yahoo.com>
Date: 5 May 2006 15:34:48 -0700
Message-ID: <1146868488.485649.224660@j33g2000cwa.googlegroups.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US