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: Robert A Duff Subject: Re: Enumeration representation Date: 1999/09/13 Message-ID: #1/1 X-Deja-AN: 524448917 Sender: bobduff@world.std.com (Robert A Duff) References: <37D8E3BC.175DB72C@newtech.it> <7rcceh$anh$1@nnrp1.deja.com> <7rhkte$na7$1@nnrp1.deja.com> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 1999-09-13T00:00:00+00:00 List-Id: Robert Dewar writes: > In article , > Keith Thompson wrote: > > I still think that enumeration representation clauses, as > currently > > defined, are more trouble than they're worth. > > I definitely agree, and they have a very nasty implementation > dependence, namely whether arrays with this index type have > holes or not (the RM does not specify). That's a general problem with high-level languages: If there's more than one "reasonable" way to implement some feature, you can end up with portability problems. Formally, this is "just" an efficiency issue, so the RM doesn't address it. But it's such a huge efficiency issue that it affects your design. Similar examples: generics (whether code is shared or not) and mutable records (whether they implicitly use the heap). It's not easy to write RM-style wording that requires one particular implementation of these features, but it would certainly be desirable if all compilers took the same approach. Lower-level languages like C don't have this problem (at least not much) -- for just about any feature of C, you can pretty much guess what the compiler is going to do with it. I agree that enum rep clauses are not worth the trouble -- they shouldn't be in the language. By the way, I think the Ada 83 Rationale had some words that made it seem like the designers thought pragma Pack ought to control whether arrays have holes or not. That's not a very good solution, though, and the RM gives no hint of it. > Well it is easy enough to use unchecked conversion Well, if the enumeration type is a generic formal... - Bob -- Change robert to bob to get my real email address. Sorry.