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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Community Input for the Maintenance and Revision of the Ada Programming Language Date: Fri, 11 Aug 2017 08:08:12 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <79e06550-67d7-45b3-88f8-b7b3980ecb20@googlegroups.com> <9d4bc8aa-cc44-4c30-8385-af0d29d49b36@googlegroups.com> <1395655516.524005222.638450.laguest-archeia.com@nntp.aioe.org> <1502382504.2184.6.camel@obry.net> <1040032843.524077622.950797.laguest-archeia.com@nntp.aioe.org> <183e2377-26b9-436f-830f-ba2021d455f6@googlegroups.com> NNTP-Posting-Host: MajGvm9MbNtGBKE7r8NgYA.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 Content-Language: en-US X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:47696 Date: 2017-08-11T08:08:12+02:00 List-Id: On 2017-08-11 03:02, Lucretia wrote: > On Thursday, 10 August 2017 18:25:30 UTC+1, Dmitry A. Kazakov wrote: > >>>> Should not they be named? Then it is an anonymous record type: >>>> >>>> function Blah return >>>> record Count : Integer; Value : Float end record; > > No, I would prefer notation for tuples, say <> or [] as they have no > use in Ada, or just use () like we do for everything else. In the > compiler, it could just generate records. > > function Blah return ; These are different things: 1. type definition 2. aggregate Clearly, for aggregates () must be used, which is tuple mathematical notation too. For type definition record is IMO obvious choice. > then you could pass Blah to function which took as input (only) a tuple which matched. > > procedure Do_Thing (Tuple : in ); > > Do_Thing (Blah); > > Tuple : := Blah; > > or: > > Count : Integer; > Value : Float; > > Count, Value := Blah; This is the key issue: tuple flattening. Flattening is when a tuple is used in a list like you did with the assignment of two assorted variables above. Or when a tuple is used in plain list of parameters as I illustrated before. You need syntax rules for that. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de