From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=BAYES_00,FROM_ADDR_WS autolearn=no autolearn_force=no version=3.4.5-pre1 Date: 11 Sep 93 23:23:54 GMT From: cs.utexas.edu!utnut!utcsri!csri.toronto.edu!blaak@uunet.uu.net (Raymond Blaak) Subject: thoughts on "holey" enumerated types Message-ID: <1993Sep11.192353.19703@jarvis.csri.toronto.edu> List-Id: The thread on converting integers to a sparse enumerated type has got me thinking. Couldn't enumerated types always be implemented as a contiguous range, such that use clauses to specify member ``positions'' just affected the 'POS and 'VAL functions? That way enumerated type operations (especially loop traversal over a range, or array indexing) can always be efficient. The only time one needs to know a member's position is when converting to an integer. Using 'POS and 'VAL seems safer than unchecked_conversion in these cases anyway. Ray blaak@csri.toronto.edu