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.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,73175d2d01a1b1dd X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.8.229 with SMTP id u5mr6996288pba.0.1317741053125; Tue, 04 Oct 2011 08:10:53 -0700 (PDT) Path: lh7ni11397pbb.0!nntp.google.com!news1.google.com!news.glorb.com!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!gegeweb.org!gegeweb.42!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Tue, 04 Oct 2011 17:10:51 +0200 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: subprogram must not be deeper than access type References: <818752663338654817.822041rmhost.bauhaus-maps.arcor.de@news.arcor.de> <15r7hdzgyr0fc.1djn7vwy23dfg$.dlg@40tude.net> <1uqthqxzri6j3.i18ifhbwmzdc.dlg@40tude.net> <10bj41auuxi17$.42qw3wdubqn3.dlg@40tude.net> In-Reply-To: Message-ID: <4e8b21fc$0$6571$9b4e6d93@newsspool3.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 04 Oct 2011 17:10:52 CEST NNTP-Posting-Host: 6ea8b608.newsspool3.arcor-online.net X-Trace: DXC=RR3bJN@@G]8RadXUBHgFh3McF=Q^Z^V384Fo<]lROoR18kF:Lh>_cHTX3j=E]0DdiR4nB? X-Complaints-To: usenet-abuse@arcor.de Xref: news1.google.com comp.lang.ada:18291 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Date: 2011-10-04T17:10:52+02:00 List-Id: On 04.10.11 09:58, Dmitry A. Kazakov wrote: > ------------------------------ > BTW, the list of parameters of a subprogram is an anonymous record type, > but Ada does not require its explicit declaration, e.g. > > type Integer_Tuple is record > Left : Integer; > Right : Integer; > end record; > function "+" : Integer_Tuple return Integer; To better meet programmer expectations, functions could then return lists of values as objects of a similar anonymous record type. (Left, Right) := Explode (Argument); With accessors, this is more interesting. Let F2 return a pair of accessorable (?) objects: (F2 (A), F2 (B)) := -- 4-tuple Explode (Argument) & Explode (Argument); "&" would then become a suitably overridden operation of some anonymous type. Perhaps also (F2 (A), F2 (B)) := Explode_3 (Argument) & Explode (Argument)(2); assuming that indexing starts at 1. SCNR