From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,bf5045b7cee3d4b X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.germany.com!newsfeed2.scan-plus.net!newsfeed.velia.net!noris.net!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: tagged type as generic parameter Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <602e79cf-755f-4600-a2cd-0cabf781136a@e25g2000prg.googlegroups.com> <17k6uddmxknzi$.1q1crpca0ygrf.dlg@40tude.net> <837jlf.9p9.ln@hunter.axlog.fr> Date: Thu, 3 Jan 2008 20:20:41 +0100 Message-ID: NNTP-Posting-Date: 03 Jan 2008 20:20:44 CET NNTP-Posting-Host: adad1953.newsspool1.arcor-online.net X-Trace: DXC=HDBK>L_]8>0=FQB?mjjV50ic==]BZ:af>4Fo<]lROoR14nDHegD_]R5@T]`AmV<1F7DNcfSJ;bb[5IRnRBaCdhfl:aCbVd97I4hjD\X 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