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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.31.131.73 with SMTP id f70mr2339093vkd.33.1480586769484; Thu, 01 Dec 2016 02:06:09 -0800 (PST) X-Received: by 10.157.44.172 with SMTP id p41mr2345587otb.6.1480586769446; Thu, 01 Dec 2016 02:06:09 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!p16no703529qta.1!news-out.google.com!j8ni2641qtc.0!nntp.google.com!n6no704751qtd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 1 Dec 2016 02:06:09 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=91.55.208.177; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf NNTP-Posting-Host: 91.55.208.177 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <775371f7-1768-431d-8879-74598ffe0934@googlegroups.com> Subject: Re: Ada 2012 Constraints (WRT an Ada IR) From: AdaMagica Injection-Date: Thu, 01 Dec 2016 10:06:09 +0000 Content-Type: text/plain; charset=UTF-8 Xref: news.eternal-september.org comp.lang.ada:32544 Date: 2016-12-01T02:06:09-08:00 List-Id: Am Mittwoch, 30. November 2016 00:52:20 UTC+1 schrieb Randy Brukardt: > >Subtype P2 is Integer with Static_Predicate => P2 in 1..Integer'Last or > >else raise Constraint_Error; > > P2 is different than the others when used in a membership: > > Obj in P2 > > would raise Constraint_Error rather than return False (like the others) if > Obj has the value 0. It's not recommended. P2 is illegal, expression is not predicate static (RM 3.2.4(16-22)) subtype P2d is Integer with Dynamic_Predicate => P2d in 1..Integer'Last or else raise Constraint_Error; Hm, GNAT GPL 2016 returns False for membership (0 in P2d); no exception.