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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Peculiarities of "of" syntax Date: Mon, 13 Jan 2020 17:32:36 -0600 Organization: JSA Research & Innovation Message-ID: References: <56cb7bc3-b966-4708-8cc7-657712d77047@googlegroups.com> Injection-Date: Mon, 13 Jan 2020 23:32:37 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="1950"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader01.eternal-september.org comp.lang.ada:57837 Date: 2020-01-13T17:32:36-06:00 List-Id: "Alejandro R. Mosteo" wrote in message news:56cb7bc3-b966-4708-8cc7-657712d77047@googlegroups.com... > Yes, apologies about the array declaration error. That was part of an > early attempt at an example, I tested it but then forgot to fix it when > finishing the post. > > Fixing the array will give the errors I mention, and as you point out the > grammar specifies a name. > > So the question would be, with a correct array, why a name is required > instead of an expression, >or why a qualified expression is good enough but an unambiguous plain >expression is not. A qualified expression, a type conversion, and a function call are all "names". You can always use a qualified expression to turn any "expression" into a "name". > A normal function call will work there too, so why not the poor infix > operator... The usual reason is that infix operators would make the grammar ambigious; that depends on what follows them. There are cases where that isn't a problem (this might be one of them). I don't think anyone was thinking about using expressions in this context, the intent was to iterate over an object. Of course, Bob is right that the difference between "name" and "expression" (and similarly "value" and "object") are minor enough that it would be nice to eliminate them. (But it's also a lot of work, and we decided not to try for Ada 202x.) Randy.