comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <bauhaus@futureapps.de>
Subject: Re: Generic procedures and their parameters
Date: Thu, 07 Sep 2006 08:48:21 +0200
Date: 2006-09-07T10:46:59+02:00	[thread overview]
Message-ID: <44ffdc83$0$18489$9b4e6d93@newsspool3.arcor-online.net> (raw)
In-Reply-To: <b5ezeh7gqghz.1gpog2d99hu0b$.dlg@40tude.net>

Dmitry A. Kazakov wrote:

> But this all is independent on the question whether interface and
> implementation inheritances are different things. They are not. 

Suppose I have some complex number type C
having a lengthy division operation that requires
auxiliary components in the implementation.

Now I want a type of complex numbers just like C
but without a division operation.
One way to do so might seem to inherit a D from C,
and clear the division operation,

   type C is tagged private;
   ...
   procedure division(a, b: C; result: in out C);


   type D is new C with private;
   ...
   overriding
   procedure division(a, b: D; result: in out D) is null;

(Is there anything better than null BTW? It won't remove
division from D's interface...)
This will leave the auxiliary components of C in D.

But couldn't I do better? For example, by declaring
the interface I want, and then requesting that the needed
operations be "extracted" from C, dropping the division
stuff (provided there is a way to mark components as being
needed by only some set of operations.)

I will loose view conversions to C.
But if that is what I want? Just a composition of
the interface I need in some scope?



  reply	other threads:[~2006-09-07  6:48 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-06  8:51 Generic procedures and their parameters Maciej Sobczak
2006-09-06  9:43 ` Dmitry A. Kazakov
2006-09-06 12:36   ` Maciej Sobczak
2006-09-06 13:11     ` Robert A Duff
2006-09-06 14:14       ` Maciej Sobczak
2006-09-06 15:09         ` Dmitry A. Kazakov
2006-09-06 16:35           ` Georg Bauhaus
2006-09-07  7:32             ` Dmitry A. Kazakov
2006-09-07  6:48               ` Georg Bauhaus [this message]
2006-09-07 10:19                 ` Dmitry A. Kazakov
2006-09-08  9:11           ` Maciej Sobczak
2006-09-08 10:19             ` Dmitry A. Kazakov
2006-09-09 14:49         ` Robert A Duff
2006-09-09 15:34           ` Dmitry A. Kazakov
2006-09-09 23:26           ` Jeffrey R. Carter
2006-09-10 11:49             ` Robert A Duff
2006-09-10 19:43               ` Jeffrey R. Carter
2006-09-06 13:02   ` Robert A Duff
2006-09-06 14:09     ` Dmitry A. Kazakov
2006-09-08  3:35   ` Randy Brukardt
2006-09-08  7:21     ` Dmitry A. Kazakov
2006-09-09  1:29       ` Randy Brukardt
2006-09-09  7:14         ` Dmitry A. Kazakov
2006-09-09 14:32         ` Robert A Duff
2006-09-06 12:56 ` Robert A Duff
2006-09-07  2:47 ` Steve
2006-09-07  7:47   ` Dmitry A. Kazakov
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox