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,6aa1ec264ce25142 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.66.86.72 with SMTP id n8mr3141808paz.24.1346195396874; Tue, 28 Aug 2012 16:09:56 -0700 (PDT) Received: by 10.68.136.7 with SMTP id pw7mr19142pbb.1.1346195396857; Tue, 28 Aug 2012 16:09:56 -0700 (PDT) Path: t10ni106882016pbh.0!nntp.google.com!4no23862147pbn.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 28 Aug 2012 16:09:56 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ NNTP-Posting-Host: 66.126.103.122 References: <1p5r39cusgc1n$.18nj9sytckk6$.dlg@40tude.net> <289703e7-1fba-41ce-b781-9e58ff2ec7df@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <767cba0f-4116-4a59-8e1d-d186b283e481@googlegroups.com> Subject: Re: Real syntax problems in Ada From: Adam Beneschan Injection-Date: Tue, 28 Aug 2012 23:09:56 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-08-28T16:09:56-07:00 List-Id: On Tuesday, August 28, 2012 2:49:20 PM UTC-7, Randy Brukardt wrote: > >> 2. "end record" instead of "end "; >=20 > > >=20 > >Yep, this is one I wish were different. After working with Ada for abou= t=20 > >24 years > > I still sometimes type in "end " before I catch myself. > I feel that way too, but there is a semantic reason why this isn't possib= le.=20 > Specifically, the part after the "is" of a type declaration is a "type=20 > definition". These are anonymous and can appear in various other contexts= =20 > (anonymous array and access types, for instance). The name of a type come= s=20 > from the type declaration, which is a separate semantic entity (and has= =20 > subtly different rules). I know that Janus/Ada processes "type definition= s"=20 > separately from the declarations, and thus including a name in the anonym= ous=20 > part would be difficult to manage. >=20 > I once seriously looked at proposing allowing a name in a record type=20 > declaration, and I couldn't figure out a reasonable way to do so given th= e=20 > existing Ada semantics. Figuring out some way to hack the wording so that= =20 > the name associated with the declaration somehow can be matched in the=20 > definition would seem to require changes all over the standard all out of= =20 > proportion to the size of the problem. So I don't think this is ever goin= g=20 > to happen. Off the top of my head, it seems like you could modify 3.8 to allow "end " in a record_type_definition, without saying anything in the Leg= ality Rules (in 3.8) about the identifier. Then, in 3.2.1, you can add a L= egality Rule that if a full_type_declaration includes a record_type_definit= ion, and the record_type_definition ends with "end ", then the = identifier name must match the defining_identifier of the type declaration.= This would mean that if a record_type_definition is used anywhere else be= sides a full_type_declaration, then the identifier could be anything you wa= nt, which would be weird. But that's not a real problem, since record_type= _definition is used only in one place in the syntax. It seems a little hac= ky since the Legality Rule would be in the wrong place, but I think it woul= d work and wouldn't affect anything else in the RM. =20 -- Adam