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,fb264cdd67c2f20f X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newspeer.monmouth.com!newsgate.cistron.nl!xs4all!feeder.news-service.com!newsfeed.freenet.de!newsfeed01.chello.at!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: A smaller self contained test case. Was: Compiler Bug or what I'm doing wrong? 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: <05lkrrojfd.fsf@hod.lan.m-e-leypold.de> <1cfjjgsg6wwv4.44snml2yzt42$.dlg@40tude.net> <7sr71erb6j.fsf@hod.lan.m-e-leypold.de> Date: Sat, 24 Jun 2006 14:52:37 +0200 Message-ID: NNTP-Posting-Date: 24 Jun 2006 14:52:37 MEST NNTP-Posting-Host: 5ffbf2b3.newsread4.arcor-online.net X-Trace: DXC=Y=^f]P:7:fMC;_l<5e4khA:ejgIfPPldDjW\KbG]kaMH]kI_X=5KeaF_>gX29:I5`D[6LHn;2LCVN[ On 24 Jun 2006 14:27:16 +0200, M E Leypold wrote: > "Dmitry A. Kazakov" writes: > >> ARM 13.13.2 (9) reads: >> >> "If T is a discriminated type, discriminants are included only if they >> have defaults." > > I understood it like this: If the discrimant has defaults the type is > definite (translate that as "has fixed memory allocation > requirements"). Then 'Read is expected to handle the type. Else (no > default discriminant) the type is indefinite ("no fixed memory > allocation requirement") and 'Input would be the appropriate function > to read from a Stream, but it would essentially read the discriminats, > allocate memory and then invoke 'Read. Input is always appropriate, Read only if constraints are fixed during object life time [informally]. BTW, I wouldn't use discriminants with defaults, and in any case, would use Input for them. Further, in this particular case, I'd expect Read be less effective than Input: 1. You have the discriminant stored anyway (that was the choice about having the defaults), so you cannot use one stored value of the discriminant for all 400 fields, even if they had it same. 2. Read means that you have one extra initialize / finalize pair. Input does not: declare X : Foo renames Foo'Input (S); -- Initializes only once begin [...] > The hypothesis that the wrong finalizers are being run could be tested > of course (by using a custom controlled type), but I haven't done it > yet (fixing my application or getting a new Gnat as obviously > priority). My experience with GNAT tells me: slowly, don't hurry. You never know which new bug it could have. (:-() -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de