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: 103376,a9bab26b6fe54a36 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder.news-service.com!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!news.weisnix.org!newsfeed.ision.net!newsfeed2.easynews.net!ision!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Tue, 10 May 2011 12:12:10 +0200 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Pondering what rationale behind record type References: <90148303-4dc4-4c05-882f-88dd69a95494@z13g2000prk.googlegroups.com> <92quueFnsfU1@mid.individual.net> <4dc864b9$0$6890$9b4e6d93@newsspool2.arcor-online.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <4dc90f7a$0$7659$9b4e6d93@newsspool1.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 10 May 2011 12:12:10 CEST NNTP-Posting-Host: 8ac21cb5.newsspool1.arcor-online.net X-Trace: DXC=0Q[TH]OCB;TV;Ef1`Jk54\ic==]BZ:af^4Fo<]lROoRQ<`=YMgDjhgRkkVBCm`oO1Znc\616M64>ZLh>_cHTX3j]1l On 10.05.11 09:45, Dmitry A. Kazakov wrote: > On Tue, 10 May 2011 00:03:37 +0200, Georg Bauhaus wrote: > >> First, in the phrase "end X", the "X" part can usually be omitted. > > That is another fix to do: a default profile which would forbid omitting > the name. I saw no Ada program in my life which omitted names in the ends. > >> So whenever we put "record" (or "case", or "if", etc) after an "end", > > These are anonymous constructs. Though a loop can have a name. Anything wrong with (i.e. makes you shudder) Label_A: loop ... end loop Label_A; ? > The only reason why record bracket should > not contain its name is when there is no name, e.g. as Randy has pointed > out, in an anonymous record type. They are illegal in Ada, but an imaginary > example could be: > > function Get_Token (File : File_Type) return > (Matched : Boolean; Length : Positive) record > ... In order to be competitive in the current discussion, pro "end [X]", the example would have to be type Get_Token is function (File : File_Type) return ((Matched : Boolean; Length : Positive) record case Matched is when True => Token : String (1..Length); when False => null; end case; end record) end Get_Token;