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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,85d5a13738392342 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Unknown discriminants with nested records Date: Fri, 17 Jun 2011 10:50:52 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <1e197c14-a2ff-4867-85be-fda06a10e37b@a7g2000vby.googlegroups.com> <2191e8b5-e827-41e8-b8a0-f02b8a68362c@v10g2000yqn.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1308322252 19839 192.74.137.71 (17 Jun 2011 14:50:52 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Fri, 17 Jun 2011 14:50:52 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:RZ9ihd2/muoHaHg4f0sdoFvgCW4= Xref: g2news1.google.com comp.lang.ada:19922 Date: 2011-06-17T10:50:52-04:00 List-Id: Simon Belmont writes: > Thank you very much, that was the exact answer I was looking for. I > was supposing too much about the operation of the unknown discriminent > marker; I figured it was more of a "known-but-I-won't-tell-you-because- > you-don't-need-to-know" marker than an actual "unknown", and that the > compiler would be able to determine that the record in question > didn't, in fact, have any real discriminents. If it worked that way, then it would break the contract on the private type. That is, you could make changes to the private part that would affect the legality of clients. Ada is designed to avoid that sort of privacy breaking -- the content of the private part should never affect the legality of any code outside that package. Jeff Carter is correct about the original reason for the (<>) feature -- to fix the generic contract model, which was broken in Ada 83. - Bob