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: 103376,a568c3c1e0be03bf X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.220.230 with SMTP id pz6mr488945pbc.3.1340303382295; Thu, 21 Jun 2012 11:29:42 -0700 (PDT) MIME-Version: 1.0 Path: l9ni4078pbj.0!nntp.google.com!news1.google.com!goblin1!goblin2!goblin.stu.neva.ru!news.stack.nl!nuzba.szn.dk!news.jacob-sparre.dk!munin.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Streams and abnormality Date: Thu, 21 Jun 2012 13:29:35 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <9cd8589d-e8c1-402e-822e-d57aac39948e@googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1340303380 645 69.95.181.76 (21 Jun 2012 18:29:40 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 21 Jun 2012 18:29:40 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-RFC2646: Format=Flowed; Original Date: 2012-06-21T13:29:35-05:00 List-Id: "Adam Beneschan" wrote in message news:b05bd568-3d76-4816-ad25-95bb8175b802@googlegroups.com... On Tuesday, June 12, 2012 10:32:00 AM UTC-7, Simon Wright wrote: >> Looking at the AI[2], I must say I don't see quite where the >> "discriminants or if the component_declaration has a default_expression" >> comes from. > >Well, the wording was there in the first version of Ada 95 (AI95-195 didn't >change it). >!summary 7 has to do with discriminants that don't match when 'Read is >called, the >discriminants have default expressions (otherwise they're not read from the >stream), >and the actual parameter is constrained. It doesn't address the issue of >invalid representations. >In RM12, the wording will be changed to "for each scalar component that is >a discriminant or >that has an implicit initial value". But I think this indicates that the >wording was deliberate. >I don't know why it was important to specify this for components with >default expressions (or >implicit initial values), and the Ada 95 Rationale doesn't say. The idea (I think) is that components with valid initial values can't get "deinitialized" by streaming in garbage. But if they're not initialized, then its OK for them to have garbage (since they start out that way anyway). There is a similar rule for "out" parameters - for Ada 2012, we had to include values that are initialized via a "Default_Value" aspect (which is why the wording changes). Randy.