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,73175d2d01a1b1dd X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Received: by 10.68.38.134 with SMTP id g6mr27371618pbk.6.1317109902147; Tue, 27 Sep 2011 00:51:42 -0700 (PDT) Path: lh7ni5826pbb.0!nntp.google.com!news1.google.com!goblin1!goblin.stu.neva.ru!txtfeed2.tudelft.nl!tudelft.nl!txtfeed1.tudelft.nl!feeder.news-service.com!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: subprogram must not be deeper than access type Date: Tue, 27 Sep 2011 09:52:09 +0200 Organization: cbb software GmbH Message-ID: <10bj41auuxi17$.42qw3wdubqn3.dlg@40tude.net> References: <818752663338654817.822041rmhost.bauhaus-maps.arcor.de@news.arcor.de> <15r7hdzgyr0fc.1djn7vwy23dfg$.dlg@40tude.net> <1uqthqxzri6j3.i18ifhbwmzdc.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news1.google.com comp.lang.ada:18152 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Date: 2011-09-27T09:52:09+02:00 List-Id: On Tue, 27 Sep 2011 07:50:54 +0200, J-P. Rosen wrote: > Le 26/09/2011 21:30, Dmitry A. Kazakov a �crit : >> I'd like to have anonymous types in record components. It is annoying not >> to be able to write: >> >> type Foo is record >> Nested : record >> end record; >> List : array (...) of ...; >> end record; >> > "Annoying to write" was never an issue in Ada, where we favor ease of > reading over ease of writing. Forward type declarations of types used only for components (and BTW, for generic instances) are very annoying especially for reading. > If your Nested component represents a > logical entity of your problem domain, it deserves a name (i.e. a type). > And what could you do with this component? Without a type name, no > subprogram could operate on it. It is meant only to have large record types structured. E.g. type Buffer_Implementation (Size : Positive) is record Position : record In_Index : ...; Out_Index : ...; ... end record; Consumer_Notification : record ... end record; Data : array (1..Size) of Octet; ... No special meaning other than grouping other components. Compare it with declare-begin-end blocks they too have no names and have no identifiable counterpart in the domain, just an implementation detail. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de