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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c9f437cff8842e X-Google-Attributes: gid103376,public From: Keith Thompson Subject: Re: Enumeration representation Date: 1999/09/13 Message-ID: #1/1 X-Deja-AN: 524667973 Sender: kst@king.cts.com References: <37D8E3BC.175DB72C@newtech.it> <7rcceh$anh$1@nnrp1.deja.com> <7rhkte$na7$1@nnrp1.deja.com> <7rjn38$7e1$1@nnrp1.deja.com> X-Trace: nusku.cts.com 937264279 64795 198.68.168.21 (13 Sep 1999 23:11:19 GMT) Organization: CTS Network Services Newsgroups: comp.lang.ada X-Complaints-To: newsmaster@cts.com Date: 1999-09-13T00:00:00+00:00 List-Id: Robert Dewar writes: > You look and see whether it is signed!!! > > If you insist on not knowing it is harder. > > It is even harder if you insist on handcuffing yourself > and typing with your nose :-) > > In a real situation, you know what type you are dealing with > and the section of code that has the enum type can export the > corresponding integral type and indeed the routine for doing > the conversion! What if the type is declared in code over which you have no control? Yes, you can probably look at the source code, but it could change in the next release. For that matter, what if it's a generic formal parameter? If this feature had been better designed (IMHO), it would be possible to get at the internal representation in a way that won't break if the type or the representation is changed -- just recompile and it works. I think we're all agreed on the proper solution: avoid enumeration representation clauses whenever possible. I gotta try that handcuff thing some time! -- Keith Thompson (The_Other_Keith) kst@cts.com San Diego Supercomputer Center <*> "Oh my gosh! You are SO ahead of your time!" -- anon.