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,45a9122ddf5fcf5 X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Valid Attribute and Unchecked Conversion Date: 1996/10/12 Message-ID: #1/1 X-Deja-AN: 189015712 references: <325E70C5.1DB8@watson.ibm.com> organization: New York University newsgroups: comp.lang.ada Date: 1996-10-12T00:00:00+00:00 List-Id: iNorman Cohen says "But the work necessary to do this (mapping sparse encodings to a contiguous set of values that can be used for array indexing) is already necessary anyway to implement the 'Pos attribute." My goodness, that's perhaps 10% of the effort involved, that's the easy part. If you want to investigate this statement further, feel free to examine the GNAT sources. Have a look at exp_pakd.adb where most, but certainly not all the work is done. Luckly in GNAT we could piggyback off the packed array stuff, which was already done in the front end (it might be better to do it in the backend, but that's for the future, and luckily for this particular issue, was not done yet!) Yes, conceptually, the only issue is the mapping, but the problem is that you have a situation where the conceptual type and the implementation type are different (the conceptual type is indexed by the enumeration type, the actual type by the representation of the enumeration type, for us these are two separate types). As always, it is the implementation details, not the algorithms that are the hard work!