comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: tagged type as generic parameter
Date: Thu, 3 Jan 2008 20:20:41 +0100
Date: 2008-01-03T20:20:44+01:00	[thread overview]
Message-ID: <x14u9icc0xhi.bhdfar88rgd8.dlg@40tude.net> (raw)
In-Reply-To: 837jlf.9p9.ln@hunter.axlog.fr

On Thu, 03 Jan 2008 18:47:12 +0100, Jean-Pierre Rosen wrote:

> To be honnest, some languages offer 
> inheritance as the only way, so there is no choice.

There is nothing automatically wrong in doing aggregation per inheritance
if one can hide undesired side effects in public interfaces:

   type Container is private;
private
   type Container is new Contained...;

I can imagine Ada without built-in record types, but with record interfaces
implemented via privately made multiple inheritance. One can always escape
the base type class in Ada by deriving privately. Unfortunately "type X is
new Y" does not work for tagged types. Otherwise it would be even better.

Important to me is consistency of the language design preventing suspicious
code from being compiled. It did not compile because in Ada:

1. Generics are contracted;
2. Primitive operations are ones in all arguments and the result;
3. Private does not leak.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  parent reply	other threads:[~2008-01-03 19:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-03 15:20 tagged type as generic parameter Philippe Tarroux
2008-01-03 15:51 ` Dmitry A. Kazakov
2008-01-03 16:22   ` Adam Beneschan
2008-01-03 16:58     ` Dmitry A. Kazakov
2008-01-03 17:47       ` Jean-Pierre Rosen
2008-01-03 18:13         ` Pascal Obry
2008-01-03 19:20         ` Dmitry A. Kazakov [this message]
2008-01-03 21:37         ` Jeffrey R. Carter
2008-01-04 13:08           ` Philippe Tarroux
2008-01-04 15:03             ` Jean-Pierre Rosen
2008-01-04 13:08   ` Philippe Tarroux
2008-01-04 13:22     ` Georg Bauhaus
2008-01-04 15:38       ` Philippe Tarroux
2008-01-04 14:17     ` 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