comp.lang.ada
 help / color / mirror / Atom feed
From: "Ant" <ant@work.invalid>
Subject: Re: Test for > 'last
Date: Mon, 17 Mar 2003 11:28:21 -0000
Date: 2003-03-17T11:28:21+00:00	[thread overview]
Message-ID: <3e75b1af$0$900$9b0f33e3@clyde> (raw)
In-Reply-To: b4t635$22plon$1@ID-175126.news.dfncis.de

"Vinzent Hoefler" <JeLlyFish.software@gmx.net> wrote in message
news:b4t635$22plon$1@ID-175126.news.dfncis.de...
>"Ant" <ant@work.invalid> wrote:

[...]
>>I would rather do this:
>>
>>if enum_input not in enum_type'first .. enum_type'last then
>>  -- handle error
>>end if;
>
>And would be wrong, too, if enum_input also has the type enum_type.
>
>If you look closer to this, this statement does not make sense and the
>compiler is indeed not required to check this, because the contract
>tells him, this condition will *always* be false (even if in fact it
>might not be). What else should a enum_input contain than some value
>of enum_type?
>
>Either use 'Valid or use a type that is allowed to contain values
>outside the range of the type to be compared with.

Yes. I can see it's all nonesense now, in the context of enumerated
types. I was looking at the test, and stating my preference for the use
of 'x in y .. z', rather than 'x < y or x > z ' type of construct.





  reply	other threads:[~2003-03-17 11:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-14 12:06 Test for > 'last Peter Richtmyer
2003-03-14 12:24 ` Jeffrey Creem
2003-03-14 17:22 ` Ant
2003-03-14 18:10   ` Vinzent Hoefler
2003-03-17 11:28     ` Ant [this message]
2003-03-15  2:02 ` Jeffrey Carter
replies disabled

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