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,147f221051e5a63d X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder3.cambrium.nl!feeder4.cambrium.nl!feeder1.cambrium.nl!feed.tweaknews.nl!news.netcologne.de!newsfeed-hp2.netcologne.de!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: memory management in Ada: tedious without GC? 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: <4ddef8bf-b5b1-4d7e-b75b-386cd6c8402c@l17g2000pri.googlegroups.com> <9f2c2db4-d6c1-4cdf-884c-5cbc26ac7701@d1g2000hsg.googlegroups.com> <1qxcw3pphdlek.1jgsfwb7atdmo.dlg@40tude.net> <10j4zhb9ge8ea.156spz1dkc4vb$.dlg@40tude.net> <6z9y05h0wes6$.126fz3zrcxvae$.dlg@40tude.net> Date: Mon, 26 May 2008 10:16:46 +0200 Message-ID: <13wvn489e126b.ek2a2q31er30$.dlg@40tude.net> NNTP-Posting-Date: 26 May 2008 10:16:46 CEST NNTP-Posting-Host: 2b279d0d.newsspool2.arcor-online.net X-Trace: DXC=]>>j:cEH7[UI?44J>Z[:RQA9EHlD;3YcR4Fo<]lROoRQ8kFJ``68^M;][6LHn;2LCV^7enW;^6ZC`TIXm65S@:3>_k0lEVjB@H=Q X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:351 Date: 2008-05-26T10:16:46+02:00 List-Id: On Sun, 25 May 2008 08:35:02 -0400, Robert A Duff wrote: > "Dmitry A. Kazakov" writes: > >> type X is record >> A : Boolean := False; >> B : Integer := 1; >> C : Boolean := False; >> end record; >> >> May the compiler group A and C and initialize both them by zeroing memory? > > Yes. > >> If the initialization order were fixed, that would be illegal to do. > > No -- it's perfectly legal for the compiler to initialize in any order > here, because the order does not affect the semantics (and it's easy for > the compiler to prove that). In this case. But there could be much more complex cases with user-defined initialization involved. There should be a clear rule to determine if the semantics is order-independent. This semantics should follow from the contracts, rather than from the implementation. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de