Re: Range constraints on subprogram parameters?
- From: bdbryant@xxxxxxxxxxxxxxx (Bobby D. Bryant)
- Date: Fri, 30 Sep 2005 02:23:23 +0000 (UTC)
On Thu, 29 Sep 2005, Peter Hermann <ica2ph@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> Jeffrey R. Carter <spam@xxxxxxxx> 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
.
- References:
- Range constraints on subprogram parameters?
- From: Bobby D. Bryant
- Re: Range constraints on subprogram parameters?
- From: Jeffrey R. Carter
- Re: Range constraints on subprogram parameters?
- From: Peter Hermann
- Range constraints on subprogram parameters?
- Prev by Date: Re: New to Ada, noticing something strange.
- Next by Date: Re: What if I upgrade my Operaton System
- Previous by thread: Re: Range constraints on subprogram parameters?
- Next by thread: Re: Range constraints on subprogram parameters?
- Index(es):
Relevant Pages
|