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,9b7d3a51d0d8b6ee X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder.news-service.com!news2.euro.net!newsfeed.freenet.de!news.tu-darmstadt.de!news.belwue.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Extending discriminant types 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: <20081115101632.5f98c596@cube.tz.axivion.com> <26f0cb8c-eb3e-4c0d-85d1-f45e2c1ba4c6@j38g2000yqa.googlegroups.com> <6fcfeaa4-e70c-4f58-aa69-0e5aac145000@x8g2000yqk.googlegroups.com> <49254dd7$0$30232$9b4e6d93@newsspool1.arcor-online.net> Date: Thu, 20 Nov 2008 15:03:42 +0100 Message-ID: <16tu3a5rnqs04.yxku7qasns5k.dlg@40tude.net> NNTP-Posting-Date: 20 Nov 2008 15:03:43 CET NNTP-Posting-Host: f03f0545.newsspool2.arcor-online.net X-Trace: DXC=hD@DM^;6kEa]BlmkiiU@BiA9EHlD;3Ycb4Fo<]lROoRa^YC2XCjHcbiEL]HnTCdDNcfSJ;bb[eFCTGGVUmh?dLK[5LiR>kgb3^KoVP8T6Xa X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:2712 Date: 2008-11-20T15:03:43+01:00 List-Id: On Thu, 20 Nov 2008 12:45:27 +0100, Georg Bauhaus wrote: > Just out of curiosity, given > > type T is tagged ...; > type D is new T with ...; > type E is new D with ...; > > what would E'Base be? In Ada 83 S'Base was meant as something like "a least constrained supertype", assuming specialization as a types algebra operation. Under generalization is should be E itself. When inheritance both specializes, generalizes and deviates a bit, there might be no S'Base. So the concept was wrong. Alternatively S'Base could mean the closest parent of S, different from S. Then there is no problem, except that it would not work with MI. Wrong again. [ The right concept is class-wide (contravariant) operations, when specialization need to be dealt with. E.g. function "+" (L, R : Integer) return Integer'Class; -- Contravariant in the result. This is not Ada! ] > Assuming that D is privately tagged, would E'Base > have different effects depending on whether E's tag > is visible or not? Visibility of S'Base is of no concern, because S'Base is itself visible. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de