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.7 required=5.0 tests=BAYES_00,MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c6e6cdf6ff50e684 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-02-09 22:40:12 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!news.iac.net!news-out.cwix.com!newsfeed.cwix.com!news.maxwell.syr.edu!nntp2.deja.com!nnrp1.deja.com!not-for-mail From: Robert Dewar Newsgroups: comp.lang.ada Subject: Re: Representation clause for enumeratives Date: Sat, 10 Feb 2001 06:34:32 GMT Organization: Deja.com Message-ID: <962ndo$g08$1@nnrp1.deja.com> References: <95tqbh$ag7$1@nnrp1.deja.com> <95uh36$to0$1@nnrp1.deja.com> NNTP-Posting-Host: 205.232.38.14 X-Article-Creation-Date: Sat Feb 10 06:34:32 2001 GMT X-Http-User-Agent: Mozilla/4.61 [en] (OS/2; U) X-Http-Proxy: 1.0 x60.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 X-MyDeja-Info: XMYDJUIDrobert_dewar Xref: supernews.google.com comp.lang.ada:5093 Date: 2001-02-10T06:34:32+00:00 List-Id: In article <95uh36$to0$1@nnrp1.deja.com>, Rod Chapman wrote: > Our usual coding standards for critical and real-time work > advise against the use of enumerated types with rep. clauses - > the code gen. and runtime impact is just too gross. I disagree with this advice, and the reason behind it. That's MUCH too broad. There is no runtime impact if you do not use the type for loops, arithmetic (succ/pred) or array subscripts. If all you use it for is just assigning and comparing and literal bit output, then this can be a valuable feature. Yes, you could use named integers, but they would allow general arithmetic which is likely meaningless. For example, if you have a type representing possible opcodes on a machine and a compiler uses them only in the context of statements like generate (shr, .....) that's perfectly reasonable, and has no deleterious runtime impact. It is almost ALWAYS wrong to advise that a particular feature of the language should NEVER be used :-) Sent via Deja.com http://www.deja.com/