comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: 'raise' in aspects?
Date: Wed, 22 Oct 2014 06:45:52 +0100
Date: 2014-10-22T06:45:52+01:00	[thread overview]
Message-ID: <lymw8od5db.fsf@pushface.org> (raw)
In-Reply-To: lyr3y0d5iq.fsf@pushface.org

Simon Wright <simon@pushface.org> writes:

> Stephen Leake <stephen_leake@stephe-leake.org> 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;


  reply	other threads:[~2014-10-22  5:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-18 22:40 'raise' in aspects? Stephen Leake
2014-10-22  5:42 ` Simon Wright
2014-10-22  5:45   ` Simon Wright [this message]
2014-10-22 18:08 ` Stephen Leake
2014-10-23 22:42   ` Randy Brukardt
2014-10-24  3:22     ` Shark8
2014-10-24  7:20     ` Simon Wright
2014-10-26  5:16       ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox