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: g2news1.google.com!news3.google.com!feeder.news-service.com!newsfeed.straub-nv.de!noris.net!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Tue, 10 May 2011 00:03:37 +0200 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 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> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <4dc864b9$0$6890$9b4e6d93@newsspool2.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 10 May 2011 00:03:37 CEST NNTP-Posting-Host: 2680d66c.newsspool2.arcor-online.net X-Trace: DXC=MiKk<[IlV;CI7\_^6>c20JA9EHlD;3YcB4Fo<]lROoRA8kFejVH_C7baPKAdQOUDefRMKL5kJ X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:19203 Date: 2011-05-10T00:03:37+02:00 List-Id: On 5/9/11 10:12 PM, Anh Vo wrote: > On May 9, 1:02 pm, "Dmitry A. Kazakov" > wrote: >> On Mon, 09 May 2011 22:51:42 +0300, Niklas Holsti wrote: >>> Adam Beneschan wrote: >>>> Heh ... good question. I have to say I get tripped up by this a lot; >>>> I type things like "type Some_Type is record ... end Some_Type;" >>>> fairly frequently, and sometimes I don't catch it before the compiler >>>> does. >> >>> I make that mistake often, too. I would vote for a change in the >>> language to allow "end Some_Type" as an alternative to "end record". >> >> Count me in. > > I am in automatically. > > I am hoping that it is still time to put it in Ada 2012. Of course, we > need to hear from Randy, Tucker and others first. I'll advocate (and speculate) against, even though I frequently type "end R" when I should type "end record" (of have my editor expand it for me). There might be a fix, though. I'll list a few points that refer to bracketing constructs that I think are nicely specific. They make "end record" a logical choice, but not "end R". First, in the phrase "end X", the "X" part can usually be omitted. To have just "end [R]" in record declarations is less specific (specifically finishing off record declarations), and less informative than "end record". Second, in "end [X]", where X is a name, the corresponding left bracket for "end" either is "begin" or we have seen something that wraps around declarations of callable constructs, if I'm not missing something. So whenever we put "record" (or "case", or "if", etc) after an "end", this is delimiting a bracketed construct that is neither a block nor a {package, task, protected}. A piece of syntax that helps the reader keeping different things apart. By reversing things for reasons of contrasting the options, assume "package ... end package;" is suggested as a replacement of the current syntax. Wouldn't you instead want "package P ... end package P;" instead? Fortran and ParaSail have these conventions, I think. Consequently, how about this addition to the syntax of record declarations: type R is record ... end record R; ?