comp.lang.ada
 help / color / mirror / Atom feed
From: Anh Vo <anhvofrcaus@gmail.com>
Subject: Re: Subtype predicates
Date: Thu, 25 Aug 2016 10:28:37 -0700 (PDT)
Date: 2016-08-25T10:28:37-07:00	[thread overview]
Message-ID: <aa2ee496-f2e9-4da4-9ba4-09867c05e2de@googlegroups.com> (raw)
In-Reply-To: <nple8u$u2$1@dont-email.me>

On Wednesday, August 24, 2016 at 5:31:28 PM UTC-7, Jeffrey R. Carter wrote:
> On 08/24/2016 05:08 PM, Shark8 wrote:
> > 
> > Hm, another argument for a 'Type attribute, then we could say
> > 
> > type Human_Life_Span is range 0 .. 130
> >   with Default_Value => Human_Life_Span'Type'First; 
> 
> Perhaps. The ARG seem leary of adding features where there's a work around, and

Yes, there are a number of ways to work around. Here is my preferred way

Min_Age : constant := 0;
Max_Age : constant := 130;

type Human_Life Span_Type is new Integer range Min_Age .. Max_Age
  with Default_Value => Min_Age;

Anh Vo



  reply	other threads:[~2016-08-25 17:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-23 20:14 Subtype predicates Anh Vo
2016-08-24 13:06 ` AdaMagica
2016-08-24 16:45   ` Shark8
2016-08-24 21:18     ` Anh Vo
2016-08-24 21:32       ` Shark8
2016-08-24 21:54   ` Jeffrey R. Carter
2016-08-25  0:08     ` Shark8
2016-08-25  0:31       ` Jeffrey R. Carter
2016-08-25 17:28         ` Anh Vo [this message]
2016-08-31 18:16       ` Randy Brukardt
2016-09-01  8:09         ` J-P. Rosen
2016-09-01 20:02           ` Randy Brukardt
2016-09-01 20:16         ` Shark8
replies disabled

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