comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: Predicate and value attribute
Date: Tue, 26 Jan 2016 11:06:38 -0700
Date: 2016-01-26T11:06:38-07:00	[thread overview]
Message-ID: <n88ce7$4sp$1@dont-email.me> (raw)
In-Reply-To: <56a753d0$0$3059$426a34cc@news.free.fr>

On 01/26/2016 04:09 AM, Xavier Petit wrote:
> 
> procedure Sandbox is
>    subtype Number is String
>      with Dynamic_Predicate => Integer'Value (Number) in -1 .. 5;
> 
>    subtype Number2 is String
>      with Dynamic_Predicate => Integer'Value (Number2) in -1 | 5;
> 
>    function Check_Number3 (Item : String) return Boolean
>    is
>      (Integer'Value (Item) in -1 .. 5);
> 
>    subtype Number3 is String
>      with Dynamic_Predicate => Check_Number3 (Number3);
> 
>    Test : constant Number := "-1";
>    Test2 : constant Number2 := "-1";
>    Test3 : constant Number3 := "-1";
> 
> begin
>    null;
> end;

With GNAT 4.9.2 this compiles without problem.

-- 
Jeff Carter
"I'm a vicious jungle beast!"
Play It Again, Sam
131

  reply	other threads:[~2016-01-26 18:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-23 11:16 Predicate and value attribute Xavier Petit
2016-01-24 11:38 ` AdaMagica
2016-01-25  8:28 ` Jacob Sparre Andersen
2016-01-25 14:52 ` Xavier Petit
2016-01-26  0:28   ` Anh Vo
2016-01-26 11:09     ` Xavier Petit
2016-01-26 18:06       ` Jeffrey R. Carter [this message]
2016-01-26 20:41         ` Anh Vo
2016-01-26 20:43       ` Simon Wright
2016-01-27 22:02         ` Xavier Petit
2016-01-28  7:56           ` Simon Wright
replies disabled

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