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,5ebeef2944e4167d X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.180.24.135 with SMTP id u7mr5142834wif.3.1346980967018; Thu, 06 Sep 2012 18:22:47 -0700 (PDT) Path: q11ni5513255wiw.1!nntp.google.com!feeder3.cambriumusenet.nl!feeder1.cambriumusenet.nl!feed.tweaknews.nl!85.12.40.138.MISMATCH!xlned.com!feeder5.xlned.com!feed.xsnews.nl!border-1.ams.xsnews.nl!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!newsreader4.netcologne.de!news.netcologne.de!feeder.erje.net!news2.arglkargh.de!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Brian Drummond Newsgroups: comp.lang.ada Subject: Re: anonymous aggregates? Date: Fri, 31 Aug 2012 11:06:24 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <85mx1bwec4.fsf@stephe-leake.org> Mime-Version: 1.0 Injection-Date: Fri, 31 Aug 2012 11:06:24 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="0e44dd4a3c4e0a6e83a86f947fb780ae"; logging-data="12834"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/FqE8byQUZepmYpBwpJnRfvRcmZqXNpTQ=" User-Agent: Pan/0.135 (Tomorrow I'll Wake Up and Scald Myself with Tea; GIT 30dc37b master) Cancel-Lock: sha1:COY8pfdFHXpsimZSQpVJ16eYgKY= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: 2012-08-31T11:06:24+00:00 List-Id: On Fri, 31 Aug 2012 06:22:35 -0400, Stephen Leake wrote: > Occasionally I have the following pattern: > > declare > A : Integer; > B : Float; > > procedure Foo (A : out Integer; B : out Float); ... > In general, I prefer to initialize variables in the declaration, and > declare them constant if possible. But I can't do that here. > > One option in current Ada is to declare a record type; > > declare > type Foo_Return_Type is record > A : Integer; > B : Float; > end record; ... > But that seems like overkill, especially since the code in "..." must be > edited; all references to A must be replaced by A_B.A. All references, or just one? (in the declarations section, just after the initialisation of A_B) A : constant Integer renames A_B.A; - Brian