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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ca9eef4d5e2078ea X-Google-Attributes: gid103376,public From: "John G. Volan" Subject: Re: Beware: Rep spec on an enumeration type causes code explosion Date: 1997/12/16 Message-ID: <3496C3E0.6DA06C0E@ac3i.dseg.ti.com>#1/1 X-Deja-AN: 298760679 Content-Transfer-Encoding: 7bit References: <348F3DFC.10DB@nospam.flash.net> <3490252D.6B550F17@ac3i.dseg.ti.com> <3490B7B1.711A@nospam.flash.net> <3491E0BF.3D18@nospam.flash.net> Content-Type: text/plain; charset=us-ascii Organization: Raytheon TI Systems Mime-Version: 1.0 Reply-To: johnv@ac3i.dseg.ti.com Newsgroups: comp.lang.ada Date: 1997-12-16T00:00:00+00:00 List-Id: Ken Garlington wrote: > A response to this statement was: "There is no need for anything so > elaborate." The corresponding code did the conversion without a > check, which prompted me to ask how validity was handled. Sorry, let me clarify: I wasn't commenting on the need to use 'Valid, of course that is quite necessary. What I was getting at was that you seemed to imply that the "holey" type ought to be something other than an enumeration type, let's say an integer type; and that the programmer should write some elaborate function involving perhaps a case statement to do a mapping between valid integer values and the target enumeration type. All I was trying to show was that Ada's built-in type conversion facility can "automagically" supply this mapping, if you simply derive a "holey" enumeration type from a parent "contiguous" enumeration type. -- ------------------------------------------------------------------------ Internet.Usenet.Put_Signature (Name => "John G. Volan", Employer => "Raytheon/TI Advanced C3I Systems, San Jose, CA", Work_Email => "jvolan@ti.com", Home_Email => "johnvolan@sprintmail.com", Slogan => "Ada95: World's *FIRST* International-Standard OOPL", Disclaimer => "My employer never defined these opinions, so using " & "them would be totally erroneous...or is that just " & "nondeterministic behavior now? :-) "); ------------------------------------------------------------------------