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_at_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 Sat May 06 2006 - 00:34:48 CEST

Original text of this message