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,ca9eef4d5e2078ea X-Google-Attributes: gid103376,public From: mheaney@ni.net (Matthew Heaney) Subject: Re: Beware: Rep spec on an enumeration type causes code explosion Date: 1997/12/09 Message-ID: #1/1 X-Deja-AN: 296809703 References: Organization: Estormza Software Newsgroups: comp.lang.ada Date: 1997-12-09T00:00:00+00:00 List-Id: In article , stt@houdini.camb.inmet.com (Tucker Taft) wrote: >So in retrospect, I believe enumeration representation >clauses in Ada are a mistake. If a user wants to name >particular values, they should simply use named integer >constants, or perhaps better, named private-type constants. They can build >up various maps of their own if they want to translate to/from some kind >of "holey" representation from/to a contiguous representation. Hallelujah! I've always thought the same thing. If you want to read data off an external interface, then just read it into an integer, and convert it to an enumeration value yourself. Look Ma, no validity problems! And no hidden inefficiencies. And no compiler complexity. And so on... -------------------------------------------------------------------- Matthew Heaney Software Development Consultant (818) 985-1271