From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ac61eafbef01b3f9 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-29 15:58:06 PST Newsgroups: comp.lang.ada Path: supernews.google.com!sn-xit-03!supernews.com!hermes2.visi.com!news-out.visi.com!news-out.visi.com!hermes.visi.com!newspump.sol.net!nntp.msen.com!uunet!ash.uu.net!world!bobduff From: Robert A Duff Subject: Re: Question about 'valid Sender: bobduff@world.std.com (Robert A Duff) Message-ID: Date: Thu, 29 Mar 2001 23:56:58 GMT References: <3AB78417.236D1AFF@praxis-cs.co.uk> Organization: The World Public Access UNIX, Brookline, MA X-Newsreader: Gnus v5.3/Emacs 19.34 Xref: supernews.google.com comp.lang.ada:6222 Date: 2001-03-29T23:56:58+00:00 List-Id: Peter Amey writes: > Given X : T; > > If X'Valid is true and X is scalar is it always true that: > > X in T; > X >= T'First; > X <= T'Last; Yes. > If the answer is yes then is it still true if T is an enumeration type > with a representation clause which leads to holes in its representation. Yes. But I would be a little bit wary of compiler bugs in that area. > I am currently very interested in validating aribitrary bit patterns > that arrive via memory mapped ports and want to really understand the > role of 'valid in these cases. I would avoid hole-y enums for this purpose, and just use integer types that happen to have no extra values (eg "mod 2**32" or whatever). - Bob