comp.lang.ada
 help / color / mirror / Atom feed
From: bdbryant@mail.utexas.edu (Bobby D. Bryant)
Subject: Re: Range constraints on subprogram parameters?
Date: Fri, 30 Sep 2005 02:23:23 +0000 (UTC)
Date: 2005-09-30T02:23:23+00:00	[thread overview]
Message-ID: <dhi7iq$aj4$1@geraldo.cc.utexas.edu> (raw)
In-Reply-To: dhg8n7$s9t$1@infosun2.rus.uni-stuttgart.de

On Thu, 29 Sep 2005, Peter Hermann <ica2ph@csv.ica.uni-stuttgart.de> wrote:

> Jeffrey R. Carter <spam@spam.com> wrote:
>> Bobby D. Bryant wrote:
>> > Is it possible to specify range constraints for subprogram parameters?
>> > 
>> > E.g., if you want to require a floating point value in the range [0,1].
>> 
>> Of course:
>> 
>> type Zip_2_1 is digits 6 range 0.0 .. 1.0;
>> 
>> procedure Op (Number : in Zip_2_1);
> 
> procedure Op (Number : in Zip_2_1 range 0.3 .. 0.7);
> 
> may have been the original question?

Yes, that's what I was wanting.

It occurs to me in retrospect that it would be problematic from a
language design perspective, since it would be impossible to enforce
at compile time.

Thanks to everyone who replied.

-- 
Bobby Bryant
Austin, Texas



  parent reply	other threads:[~2005-09-30  2:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-28 20:00 Range constraints on subprogram parameters? Bobby D. Bryant
2005-09-29  5:39 ` Jeffrey R. Carter
2005-09-29  8:30   ` Peter Hermann
2005-09-29  9:06     ` Martin Dowie
2005-09-29 18:16     ` Jeffrey R. Carter
2005-09-30  2:23     ` Bobby D. Bryant [this message]
2005-09-30  5:46       ` Jeffrey R. Carter
2005-10-01  1:07         ` Randy Brukardt
2005-10-01  3:50           ` Jeffrey R. Carter
2005-10-01 14:36           ` Robert A Duff
2005-10-01 14:41             ` Robert A Duff
2005-09-30  2:24   ` Bobby D. Bryant
replies disabled

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