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: "Jean-Pierre Rosen" Subject: Re: Beware: Rep spec on an enumeration type causes code explosion Date: 1997/12/10 Message-ID: <66mkr2$k0o$1@peuplier.wanadoo.fr>#1/1 X-Deja-AN: 296976886 References: X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3 Organization: Adalog Newsgroups: comp.lang.ada Date: 1997-12-10T00:00:00+00:00 List-Id: 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. > An important issue is why is a representation clause necessary at all ? In general, it is because of some interfaces to hardware or other programming language. In this case, you can use an efficient representation for internal use, and use a representation clause only for interfaces: type Efficient_Enumeration is (...); type External_Enumeration is new Efficient_Enumeration; for External_Enumeration use (...); You would convert to External_Enumeration (and incur some overhead) only when needed.