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: a07f3367d7,6aa1ec264ce25142 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.66.85.136 with SMTP id h8mr2898608paz.46.1346166875072; Tue, 28 Aug 2012 08:14:35 -0700 (PDT) Received: by 10.66.87.161 with SMTP id az1mr717545pab.38.1346166855889; Tue, 28 Aug 2012 08:14:15 -0700 (PDT) Received: by 10.68.237.163 with SMTP id vd3mr3504007pbc.9.1346166855753; Tue, 28 Aug 2012 08:14:15 -0700 (PDT) Path: a5ni21057pbv.0!nntp.google.com!news2.google.com!r4no201118pbs.0!news-out.google.com!a8ni83829893pbd.1!nntp.google.com!r4no201105pbs.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 28 Aug 2012 08:14:15 -0700 (PDT) In-Reply-To: <1p5r39cusgc1n$.18nj9sytckk6$.dlg@40tude.net> 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> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <289703e7-1fba-41ce-b781-9e58ff2ec7df@googlegroups.com> Subject: Re: Real syntax problems in Ada From: Adam Beneschan Injection-Date: Tue, 28 Aug 2012 15:14:15 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-08-28T08:14:15-07:00 List-Id: On Tuesday, August 28, 2012 1:13:02 AM UTC-7, Dmitry A. Kazakov wrote: > What are real problems with Ada syntax as opposed to the imaginary ones >=20 > (e.g. Ada does not look like C, Forth, Elder Futhark, you name it)? Ada does not look like Intercal ... =20 > My short list: >=20 > 1. Too many unnecessarily reserved keywords; I've never found this to be a problem. Having a lot of reserved words is a= problem only if there are more than one or two that you wish you could use= as identifiers, and I haven't had this happen. For what it's worth, Ada h= as 73 keywords, Java has 50. Eiffel has somewhere from 50 to 69 (I looked = at one web page and there seems to be some dispute about whether certain pr= edefined names are reserved). C++ (the latest version) has 84, which actua= lly shocked me because I've been assuming C-type languages preferred punctu= ation characters or sequences over reserved words (e.g. & instead of "and",= && instead of "and then", { instead of "begin", etc.). =20 > 2. "end record" instead of "end "; Yep, this is one I wish were different. After working with Ada for about 2= 4 years I still sometimes type in "end " before I catch myself. > 3. "task type" and "protected type" instead of "type T is task ..."; This one just seems like a matter of personal preference, not a real proble= m. I understand what J-P said was the purpose, to make singleton tasks and= task types look the same; on the other hand, there's merit in making task = type declarations follow the same form as other type declarations. Either = way, though, this seems like a minor nuisance at best. > 4. "overriding procedure Foo" instead of "procedure Foo is overriding"; It's possible for "overriding" to occur on a procedure body (and necessary = in some less-common cases). I'd worry that if Foo has a long parameter lis= t, an overriding keyword could get buried in a case like that, making it ha= rder to spot for a reader. That's a minor point, though. > 5. "X : T :=3D E", but "procedure X is "; I'm not clear on what you mean here. > 6. Lack of per point notation for nD array aggregates, e.g. >=20 > Diag : Matrix :=3D ((1,1)=3D>1.0, (2,2)=3D>1.0, (3,3)=3D>1.0, others = =3D> 0.0); I can see how this could be useful.=20 > 7. "exception" must be required in the bodies of tasks, Initialize,=20 > Finalize (however, this could be resolved by non-syntactic means, e.g. by > contracted exceptions); This isn't really a syntax issue since you're not proposing any difference = in the grammar. (If you disagree, fine; I'm not going to get involved in a= long discussion about the definition of "syntax".) > 8. The order in which the keywords "new", "interface", "limited", > "abstract", "tagged", "private" may appear should be free. I've definitely run into problems with "limited" and "abstract"; I keep hav= ing to look up which one comes first. One could argue that some of these k= ey words are the "important" ones that tell you the main thing about what c= ategory of type it is, and those should be last; the keywords in that group= are "new", "interface", "private" (as well as "record", "array", "delta", = "digits", "range", "access"). Others are more like adjectives that modify = the type, and I can see how it would be useful to allow more freedom in the= order. With respect to *syntax* problems (as opposed to new features), my own wish= list would include allowing a generic formal part to be repeated on a gene= ric package or procedure body. (Otherwise, if the specification and body a= re in different source files, you can't see the definitions of the formal p= arameters when they're used in the body. I usually just copy in the generi= c formal part as comments.) -- Adam