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,9c9db81a63ddf1fe X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!k3g2000prl.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: extended membership tests Date: Fri, 1 Apr 2011 08:11:45 -0700 (PDT) Organization: http://groups.google.com Message-ID: <365a54c8-d060-4b2b-9778-be092ad89b14@k3g2000prl.googlegroups.com> References: <7dc23d58-4a48-4444-90cd-7f9786b19aad@i14g2000yqe.googlegroups.com> <5ab2b5ee-d08e-4e5e-93a7-808636f3cfa0@p16g2000yqb.googlegroups.com> <9e379bf0-ade3-4694-83d3-60d99f54bdf5@q36g2000yqn.googlegroups.com> <0a58c4e0-f4b5-4cab-8aa7-7ab39337664e@p13g2000yqh.googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1301670705 19217 127.0.0.1 (1 Apr 2011 15:11:45 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 1 Apr 2011 15:11:45 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: k3g2000prl.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618; .NET4.0C),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:19639 Date: 2011-04-01T08:11:45-07:00 List-Id: On Apr 1, 12:03=A0am, AdaMagica wrote: > On 1 Apr., 08:33, Dan wrote: > > > Yannick suggested making X in Y illegal, when X and Y have the same > > type, to avoid the > > confusion. =A0I agree with that suggestion. > > I also agree. > > I do not see why we need choice_expression and choice_relation RM > 4.4(2.1/3,2.2/3). > Wouldn't simple_expression suffice in (3.2/3)? That could lead to ambiguous expressions like "X in Y in Z". I suppose the authors could have just used simple_expression and then made a rule to prevent ambiguous expressions like the above, but doing it by creating a new BNF rules as they did makes things more rigorous. > membership_choice ::=3D simple_expression | range | subtype_mark > > Are there any sensible uses for (boolean) choice_relations? > I might > imagine some use of choice_expressions for modular types. > > X in A > B and C | D .. E | Subrange =A0??? doesn't look very sensible > to me > > Examples please. You may be right that there aren't many "uses" of choice_relations, but that wasn't the point. The point was that this is just a way to write syntax rules that defines an expression that doesn't allow membership tests (except inside parentheses) but otherwise has all the same rules as other expressions. And I think that's how they intended programmers to think about it. Programmers shouldn't worry about the distinction between a "relation" and a "choice_relation" any more than they should worry about the difference between a "term" and a "factor". -- Adam