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!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: 'raise' in aspects? Date: Wed, 22 Oct 2014 06:45:52 +0100 Organization: A noiseless patient Spider Message-ID: References: <85siilc88t.fsf@stephe-leake.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="71797db6fbf0039ebda7a9c799ddb33f"; logging-data="2797"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18QsNrsDiI9RYbf6Kv5t3YSlmk5qvk/xVM=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin) Cancel-Lock: sha1:a+tQIYkNiKtzhQLecd5W21SAFCE= sha1:x+/FiOvGLApp3zZQkZJ8u3+Lckg= Xref: news.eternal-september.org comp.lang.ada:22649 Date: 2014-10-22T06:45:52+01:00 List-Id: Simon Wright writes: > Stephen Leake writes: > >> And you can't put 'raise' in an expression, which is why the Ada mode >> parser rejects it. > > This is AI12-00221[1]. > > The relevant ARM section is 4.4(3)[2]. > > [1] > http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ai12s/ai12-0022-1.txt?rev=1.13 > [2] http://www.ada-auth.org/standards/2xrm/html/RM-4-4.html#p3 This code doesn't format with the latest ada-mode from mtn, but it does raise the exception: $ ./validity raised CONSTRAINT_ERROR : not an acceptable string with Ada.Text_IO; procedure Validity is S : String := "43"; B : Boolean := Integer'Value (S) in 1 .. 42 or else raise Constraint_Error with "not an acceptable string"; begin Ada.Text_IO.Put_Line (B'Img); end Validity;