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: border1.nntp.dca1.giganews.com!nntp.giganews.com!enother.net!enother.net!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: 'raise' in aspects? Date: Sat, 18 Oct 2014 17:40:02 -0500 Message-ID: <85siilc88t.fsf@stephe-leake.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.94 (windows-nt) Cancel-Lock: sha1:2lHTQqjb11zo7jakQmjD3CM2vJk= MIME-Version: 1.0 Content-Type: text/plain X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: eccf65442ec45e3fb833031737 X-Received-Bytes: 2344 X-Received-Body-CRC: 1169219718 Xref: number.nntp.giganews.com comp.lang.ada:189884 Date: 2014-10-18T17:40:02-05:00 List-Id: The Ada mode 5.0 parser rejects this code: subtype Integer_String is String with Dynamic_Predicate => Integer'Value (Integer_String) in Integer or else raise Constraint_Error with "not an integer string"; It complains that 'raise' is not allowed here. ALRM Annex P says the syntax for an aspect is: aspect_specification ::= with aspect_mark [=> aspect_definition] {, aspect_mark [=> aspect_definition] } aspect_mark ::= aspect_identifier['Class] aspect_definition ::= name | expression | identifier And you can't put 'raise' in an expression, which is why the Ada mode parser rejects it. But GNAT GPL 2014 accepts it. Maybe this is from an AI? Randy says the next Ada version is described in http://www.ada-auth.org/standards/2xrm/html/RM-13-1-1.html But that gives the same 'expression' syntax for this. Hmm; it does add: 36/3 Alternative legality and semantics rules may apply for particular aspects, as specified elsewhere in this International Standard. (that should be 36/4? 2012 is /3; this is new in 202x. or maybe it's just a clarificaton of 2012?) Searching that LRM for Dynamic_Predicate didn't turn up anything about 'raise' in aspects. There was a recent discussion on comp.lang.ada about the new aspect Predicate_Failure, and implied that 'raise' was allowed in aspectes, since the code discussed had that. Predicate_Failure is in the 202x manual, but it still doesn't give a syntax that allows 'raise'. Can anyone point me to RM language that allows 'raise' in aspects? Or maybe this is a GNAT extension? I don't see anything in the GNAT reference manual about it, but I'm not sure I know where to look. -- -- Stephe