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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.107.143.82 with SMTP id r79mr4949193iod.120.1520882226128; Mon, 12 Mar 2018 12:17:06 -0700 (PDT) X-Received: by 10.157.95.23 with SMTP id f23mr521922oti.12.1520882226003; Mon, 12 Mar 2018 12:17:06 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!nntp.giganews.com!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.am4!peer.am4.highwinds-media.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!r195no1363899itc.0!news-out.google.com!a25ni3919itj.0!nntp.google.com!r195no1363897itc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 12 Mar 2018 12:17:05 -0700 (PDT) In-Reply-To: <4cf2a76e-626d-4ead-ae8a-dccdef41b283@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2601:191:8303:2100:7466:f44c:da21:40b1; posting-account=fdRd8woAAADTIlxCu9FgvDrUK4wPzvy3 NNTP-Posting-Host: 2601:191:8303:2100:7466:f44c:da21:40b1 References: <4cf2a76e-626d-4ead-ae8a-dccdef41b283@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <2153155f-2778-421f-97cb-4d229fb9355b@googlegroups.com> Subject: Re: anonymous records as tuples From: Robert Eachus Injection-Date: Mon, 12 Mar 2018 19:17:06 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Bytes: 2076 X-Received-Body-CRC: 1739950165 Xref: reader02.eternal-september.org comp.lang.ada:50941 Date: 2018-03-12T12:17:05-07:00 List-Id: On Monday, March 12, 2018 at 1:32:46 PM UTC-4, Stephen Leake wrote: > I recently had to change a function that returned a single integer into a procedure that returns two... What is wrong with something like: -- in Tree: type Return_Values is record Real : Integer; Virtual : Integer; end record; function Count_Terminals (Index...) return Return_Values; ... declare Returned: constant Tree.Return_Values := Tree.Count_Terminals(Index); Real: Integer renames Returned.Real; Virtual: Integer renames Returned.Virtual; begin if Virtual = 0 then Next_Shared_Token := Next_Shared_Token - Real; end if; end; Declaring Returned as a constant is optional. (And declaring Real as an Integer really rubs me wrong. But this is a example...)